Skip to contentSkip to conversation

Transaction struct Op

DISCUSSION Dałek, Piotr 3 participants 4 messages Jul 2, 2015 – Jul 3, 2015

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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.

Quoted 27 lines · Piotr

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

Signature · 7 lines
Best Regards,

Wheat
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 6 lines

-----Original Message-----
From: Haomai Wang [mailto:[email protected]]
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.

Quoted 2 lines

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

#3 lore raw

I tend to support (++)

Quoted 21 lines · ----- "Piotr Dałek
Quoted 5 lines

-----Original Message-----
From: Haomai Wang [mailto:[email protected]]
Sent: Thursday, July 02, 2015 7:26 PM

Yes, some fields only used for special ops. But union may increase

the

Quoted 1 line

complexity of stuct.

Not by that much, actual changes would be only in coding and encoding, rest of the code should remain the same.

Quoted 1 line

And the extra memory may not a problem because "Ops" in one

transaction

Quoted 1 line

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"��

Signature · 14 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html