Re: [PATCH net-next 1/4] mm: page_frag: Introduce page_frag_alloc_align()

2021-01-26 Thread Vlastimil Babka
On 1/23/21 12:59 PM, Kevin Hao wrote: > In the current implementation of page_frag_alloc(), it doesn't have > any align guarantee for the returned buffer address. But for some > hardwares they do require the DMA buffer to be aligned correctly, > so we would have to use some workarounds like below i

Re: [PATCH net-next 1/4] mm: page_frag: Introduce page_frag_alloc_align()

2021-01-23 Thread Kevin Hao
On Sat, Jan 23, 2021 at 12:52:21PM -0800, Jakub Kicinski wrote: > On Sat, 23 Jan 2021 19:59:00 +0800 Kevin Hao wrote: > > +void *page_frag_alloc(struct page_frag_cache *nc, > > + unsigned int fragsz, gfp_t gfp_mask) > > +{ > > + return page_frag_alloc_align(nc, fragsz, gfp_mask, 0

Re: [PATCH net-next 1/4] mm: page_frag: Introduce page_frag_alloc_align()

2021-01-23 Thread Jakub Kicinski
On Sat, 23 Jan 2021 19:59:00 +0800 Kevin Hao wrote: > +void *page_frag_alloc(struct page_frag_cache *nc, > + unsigned int fragsz, gfp_t gfp_mask) > +{ > + return page_frag_alloc_align(nc, fragsz, gfp_mask, 0); > +} > EXPORT_SYMBOL(page_frag_alloc); Isn't it better to make th

[PATCH net-next 1/4] mm: page_frag: Introduce page_frag_alloc_align()

2021-01-23 Thread Kevin Hao
In the current implementation of page_frag_alloc(), it doesn't have any align guarantee for the returned buffer address. But for some hardwares they do require the DMA buffer to be aligned correctly, so we would have to use some workarounds like below if the buffers allocated by the page_frag_alloc