* Transaction struct Op
@ 2015-07-02 14:05 Dałek, Piotr
2015-07-02 17:26 ` Haomai Wang
0 siblings, 1 reply; 4+ messages in thread
From: Dałek, Piotr @ 2015-07-02 14:05 UTC (permalink / raw)
To: ceph-devel
Hello,
In ObjectStore.h we have the following stuct:
struct Op {
__le32 op;
__le32 cid;
__le32 oid;
__le64 off;
__le64 len;
__le32 dest_cid;
__le32 dest_oid; //OP_CLONE, OP_CLONERANGE
__le64 dest_off; //OP_CLONERANGE
__le32 hint_type; //OP_COLL_HINT
__le64 expected_object_size; //OP_SETALLOCHINT
__le64 expected_write_size; //OP_SETALLOCHINT
__le32 split_bits; //OP_SPLIT_COLLECTION2
__le32 split_rem; //OP_SPLIT_COLLECTION2
} __attribute__ ((packed)) ;
Some of the fields (like hint_type and split_rem) are totally unused in certain ops, and they eat up space anyway. Maybe we should use unions here, and re-use some of the fields for other purposes? Right now the structure is 72 bytes in size, and for most ops, at least 32 bytes are always wasted.
With best regards / Pozdrawiam
Piotr Dałek
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Transaction struct Op
2015-07-02 14:05 Transaction struct Op Dałek, Piotr
@ 2015-07-02 17:26 ` Haomai Wang
2015-07-03 6:31 ` Dałek, Piotr
0 siblings, 1 reply; 4+ messages in thread
From: Haomai Wang @ 2015-07-02 17:26 UTC (permalink / raw)
To: Dałek, Piotr; +Cc: ceph-devel
Yes, some fields only used for special ops. But union may increase the
complexity of stuct.
And the extra memory may not a problem because "Ops" in one
transaction should be within ten.
On Thu, Jul 2, 2015 at 10:05 PM, Dałek, Piotr
<Piotr.Dalek@ts.fujitsu.com> wrote:
> Hello,
>
> In ObjectStore.h we have the following stuct:
>
> struct Op {
> __le32 op;
> __le32 cid;
> __le32 oid;
> __le64 off;
> __le64 len;
> __le32 dest_cid;
> __le32 dest_oid; //OP_CLONE, OP_CLONERANGE
> __le64 dest_off; //OP_CLONERANGE
> __le32 hint_type; //OP_COLL_HINT
> __le64 expected_object_size; //OP_SETALLOCHINT
> __le64 expected_write_size; //OP_SETALLOCHINT
> __le32 split_bits; //OP_SPLIT_COLLECTION2
> __le32 split_rem; //OP_SPLIT_COLLECTION2
> } __attribute__ ((packed)) ;
>
> Some of the fields (like hint_type and split_rem) are totally unused in certain ops, and they eat up space anyway. Maybe we should use unions here, and re-use some of the fields for other purposes? Right now the structure is 72 bytes in size, and for most ops, at least 32 bytes are always wasted.
>
>
> With best regards / Pozdrawiam
> Piotr Dałek
>
>
--
Best Regards,
Wheat
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: Transaction struct Op
2015-07-02 17:26 ` Haomai Wang
@ 2015-07-03 6:31 ` Dałek, Piotr
2015-07-03 14:52 ` Matt W. Benjamin
0 siblings, 1 reply; 4+ messages in thread
From: Dałek, Piotr @ 2015-07-03 6:31 UTC (permalink / raw)
To: ceph-devel
> -----Original Message-----
> From: Haomai Wang [mailto:haomaiwang@gmail.com]
> Sent: Thursday, July 02, 2015 7:26 PM
>
> Yes, some fields only used for special ops. But union may increase the
> complexity of stuct.
Not by that much, actual changes would be only in coding and encoding, rest of the code should remain the same.
> And the extra memory may not a problem because "Ops" in one transaction
> should be within ten.
This equals to at least around 720 bytes that must be stored in RAM and transferred through the wire.
With best regards / Pozdrawiam
Piotr Dałek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Transaction struct Op
2015-07-03 6:31 ` Dałek, Piotr
@ 2015-07-03 14:52 ` Matt W. Benjamin
0 siblings, 0 replies; 4+ messages in thread
From: Matt W. Benjamin @ 2015-07-03 14:52 UTC (permalink / raw)
To: Piotr Dałek; +Cc: ceph-devel
I tend to support (++)
----- "Piotr Dałek" <Piotr.Dalek@ts.fujitsu.com> wrote:
> > -----Original Message-----
> > From: Haomai Wang [mailto:haomaiwang@gmail.com]
> > Sent: Thursday, July 02, 2015 7:26 PM
> >
> > Yes, some fields only used for special ops. But union may increase
> the
> > complexity of stuct.
>
> Not by that much, actual changes would be only in coding and encoding,
> rest of the code should remain the same.
>
> > And the extra memory may not a problem because "Ops" in one
> transaction
> > should be within ten.
>
> This equals to at least around 720 bytes that must be stored in RAM
> and transferred through the wire.
>
> With best regards / Pozdrawiam
> Piotr Dałek
> N�����r��y���b�X��ǧv�^�){.n�+���z�]z���{ay�ʇڙ�,j��f���h���z��w������j:+v���w�j�m��������zZ+��ݢj"��
--
Matt Benjamin
CohortFS, LLC.
315 West Huron Street, Suite 140A
Ann Arbor, Michigan 48103
http://cohortfs.com
tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-03 14:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-02 14:05 Transaction struct Op Dałek, Piotr
2015-07-02 17:26 ` Haomai Wang
2015-07-03 6:31 ` Dałek, Piotr
2015-07-03 14:52 ` Matt W. Benjamin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.