All of lore.kernel.org
 help / color / mirror / Atom feed
* Buffer alignment
@ 2013-12-10  8:32 Loic Dachary
  2013-12-11  9:50 ` Andreas Joachim Peters
  0 siblings, 1 reply; 3+ messages in thread
From: Loic Dachary @ 2013-12-10  8:32 UTC (permalink / raw)
  To: Andreas-Joachim Peters; +Cc: Ceph Development

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

Hi Andreas,

In Ceph, buffers can be aligned if required using buffer::create_page_aligned

https://github.com/ceph/ceph/blob/master/src/common/buffer.cc#L519
https://github.com/ceph/ceph/blob/master/src/common/buffer.cc#L230

and although the Jerasure plugin has alignment requirements

https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodePluginJerasure/ErasureCodeJerasure.cc#L79

it did not occur to me that aligning the buffers used to stored the encoded 

https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodePluginJerasure/ErasureCodeJerasure.cc#L87

result would be needed. For decoding the caller is responsible for allocating the buffers. For encoding it also is, except for the padding. 

Do you think the API should recommend something regarding alignment ? 

https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodeInterface.h#L20

Cheers

-- 
Loïc Dachary, Artisan Logiciel Libre


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Buffer alignment
  2013-12-10  8:32 Buffer alignment Loic Dachary
@ 2013-12-11  9:50 ` Andreas Joachim Peters
  2013-12-11 12:25   ` Loic Dachary
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Joachim Peters @ 2013-12-11  9:50 UTC (permalink / raw)
  To: Loic Dachary; +Cc: Ceph Development

Hi Loic, 
if you pull the BPC extension this requires 128-bit aligned memory adresses, maybe to prepare for future extensions they should be even 512-bit aligned. I can add an assertion if I see unaligned addresses.

Cheers Andreas.

________________________________________
From: Loic Dachary [loic@dachary.org]
Sent: 10 December 2013 09:32
To: Andreas Joachim Peters
Cc: Ceph Development
Subject: Buffer alignment

Hi Andreas,

In Ceph, buffers can be aligned if required using buffer::create_page_aligned

https://github.com/ceph/ceph/blob/master/src/common/buffer.cc#L519
https://github.com/ceph/ceph/blob/master/src/common/buffer.cc#L230

and although the Jerasure plugin has alignment requirements

https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodePluginJerasure/ErasureCodeJerasure.cc#L79

it did not occur to me that aligning the buffers used to stored the encoded

https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodePluginJerasure/ErasureCodeJerasure.cc#L87

result would be needed. For decoding the caller is responsible for allocating the buffers. For encoding it also is, except for the padding.

Do you think the API should recommend something regarding alignment ?

https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodeInterface.h#L20

Cheers

--
Loïc Dachary, Artisan Logiciel Libre

--
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] 3+ messages in thread

* Re: Buffer alignment
  2013-12-11  9:50 ` Andreas Joachim Peters
@ 2013-12-11 12:25   ` Loic Dachary
  0 siblings, 0 replies; 3+ messages in thread
From: Loic Dachary @ 2013-12-11 12:25 UTC (permalink / raw)
  To: Andreas Joachim Peters; +Cc: Ceph Development

[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]



On 11/12/2013 10:50, Andreas Joachim Peters wrote:
> Hi Loic, 
> if you pull the BPC extension this requires 128-bit aligned memory adresses, maybe to prepare for future extensions they should be even 512-bit aligned. I can add an assertion if I see unaligned addresses.
> 

Could you please remind me which branch of your repository I should look at ?

Cheers

> Cheers Andreas.
> 
> ________________________________________
> From: Loic Dachary [loic@dachary.org]
> Sent: 10 December 2013 09:32
> To: Andreas Joachim Peters
> Cc: Ceph Development
> Subject: Buffer alignment
> 
> Hi Andreas,
> 
> In Ceph, buffers can be aligned if required using buffer::create_page_aligned
> 
> https://github.com/ceph/ceph/blob/master/src/common/buffer.cc#L519
> https://github.com/ceph/ceph/blob/master/src/common/buffer.cc#L230
> 
> and although the Jerasure plugin has alignment requirements
> 
> https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodePluginJerasure/ErasureCodeJerasure.cc#L79
> 
> it did not occur to me that aligning the buffers used to stored the encoded
> 
> https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodePluginJerasure/ErasureCodeJerasure.cc#L87
> 
> result would be needed. For decoding the caller is responsible for allocating the buffers. For encoding it also is, except for the padding.
> 
> Do you think the API should recommend something regarding alignment ?
> 
> https://github.com/ceph/ceph/blob/master/src/osd/ErasureCodeInterface.h#L20
> 
> Cheers
> 
> --
> Loïc Dachary, Artisan Logiciel Libre
> 
> --
> 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
> 

-- 
Loïc Dachary, Artisan Logiciel Libre


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-11 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10  8:32 Buffer alignment Loic Dachary
2013-12-11  9:50 ` Andreas Joachim Peters
2013-12-11 12:25   ` Loic Dachary

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.