Currently the buffer pool code aligns the block of memory that it odp_shm_reserve()s up for buffer pool use on a 4K boundary for paging performance. My plan is to support a max buffer alignment request of 4K since I don't see a use case for RAW buffers beyond that. For packet buffers, 8 byte alignment should be sufficient but I'll be using cache line alignment by default.
On Tue, Dec 9, 2014 at 1:48 PM, Ola Liljedahl <[email protected]> wrote: > Could it be meaningful to request that the whole buffer pool or other > shared memory area has a minimum alignment? E.g. to enable or simplify > huge pages TLB mapping? Is this what you are alluding to Petri here > with shm align? > > Regarding TLB page sizes and alignment, we shouldn't be too focused on > 4KB. Many architectures support larger pages sizes (e.g. 16KB or 64KB) > also for normal TLB entries. > > > On 9 December 2014 at 15:11, Savolainen, Petri (NSN - FI/Espoo) > <[email protected]> wrote: > > Requirement for shm align maybe larger than 4KB (e.g. some number of > > MBytes). Another config for that ODP_CONFIG_SHM_ALIGN_MAX ? > > > > > > > > -Petri > > > > > > > > > > > > > > > > From: ext Bill Fischofer [mailto:[email protected]] > > Sent: Tuesday, December 09, 2014 3:07 PM > > To: Savolainen, Petri (NSN - FI/Espoo) > > Cc: lng-odp-forward > > Subject: Re: [lng-odp] Alignment question > > > > > > > > The APIs that currently support alignment are odp_buffer_pool_create() > and > > odp_shm_reserve() > > > > > > > > On Tue, Dec 9, 2014 at 7:03 AM, Bill Fischofer < > [email protected]> > > wrote: > > > > That makes sense. I'll add those additional CONFIG vars to the v3 > patch. I > > don't see a use case for alignments above 4K for RAW buffers so that's a > > reasonable upper limit, however I suspect some implementations may have > > problems with that. If a platform has a HW buffer manager that uses 512 > > byte blocks, they are going to be 512-byte aligned and it's meaningless > to > > try to ask for a higher alignment. > > > > > > > > On Tue, Dec 9, 2014 at 6:54 AM, Savolainen, Petri (NSN - FI/Espoo) > > <[email protected]> wrote: > > > > > > > > > > > > From: [email protected] > > [mailto:[email protected]] On Behalf Of ext Bill > Fischofer > > Sent: Tuesday, December 09, 2014 1:08 PM > > To: lng-odp-forward > > Subject: [lng-odp] Alignment question > > > > > > > > A number of APIs support a buf_align parameter but we haven't been > terribly > > precise about limits on this, so some questions for Petri. > > > > > > > > I think only buffer_pool_create has alignment parameter. > > > > > > > > With buf_align being defined as uint32_t in theory we can specify > alignments > > up to 2GB. > > > > > > > > 1. MAY implementations impose a lower upper limit on the alignments they > > support? > > > > > > > > ODP_CONFIG_BUFFER_ALIGN_MAX (4*1024) ? > > > > > > > > > > > > 2. If so, what is the minimum acceptable upper alignment limit? We've > > specified that buffers MUST be at minimum 8 byte aligned but is that > > sufficient? > > > > > > > > ODP_CONFIG_BUFFER_ALIGN_MIN 8 ? > > > > > > > > 3. If implementations MAY impose an upper alignment limit below 2GB, what > > SHOULD happen if an application requests an alignment above this limit? > > Fail the request? Saturate at the implementation-defined max alignment? > > > > > > > > It should fail. User requests minimum alignment, implementation can round > > up. > > > > > > > > -Petri > > > > > > > > > > > > > > > > > > _______________________________________________ > > lng-odp mailing list > > [email protected] > > http://lists.linaro.org/mailman/listinfo/lng-odp > > >
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
