Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-30 Thread Christoph Hellwig
On Thu, Jun 28, 2007 at 10:24:24PM -0700, Andrew Morton wrote: > > Really, it would be great if we could treat kmalloc() objects > > just like real pages. > > >From a high level, that seems like a bad idea. kmalloc() gives you a > virtual address and you really shouldn't be poking around at that

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-30 Thread Russell King
On Sat, Jun 30, 2007 at 12:11:38AM +0100, Alan Cox wrote: > > DMA to or from memory should be done via the DMA mapping API. If we're > > DMAing to/from a limited range within a page, either we should be using > > dma_map_single(), or dma_map_page() with an appropriate offset and size. > > If

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-30 Thread Russell King
On Sat, Jun 30, 2007 at 12:11:38AM +0100, Alan Cox wrote: DMA to or from memory should be done via the DMA mapping API. If we're DMAing to/from a limited range within a page, either we should be using dma_map_single(), or dma_map_page() with an appropriate offset and size. If those

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-30 Thread Christoph Hellwig
On Thu, Jun 28, 2007 at 10:24:24PM -0700, Andrew Morton wrote: Really, it would be great if we could treat kmalloc() objects just like real pages. From a high level, that seems like a bad idea. kmalloc() gives you a virtual address and you really shouldn't be poking around at that

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Alan Cox
> DMA to or from memory should be done via the DMA mapping API. If we're > DMAing to/from a limited range within a page, either we should be using > dma_map_single(), or dma_map_page() with an appropriate offset and size. If those ranges overlap a cache line then the dma mapping API will not

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Alan Cox
On Fri, 29 Jun 2007 13:45:29 -0700 Andrew Morton <[EMAIL PROTECTED]> wrote: > On Fri, 29 Jun 2007 13:16:57 +0100 > Alan Cox <[EMAIL PROTECTED]> wrote: > > > > If those operations involve modifying that slab page's pageframe then what > > > stops concurrent dma'ers from stomping on each other's

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Russell King
On Fri, Jun 29, 2007 at 01:45:29PM -0700, Andrew Morton wrote: > On Fri, 29 Jun 2007 13:16:57 +0100 > Alan Cox <[EMAIL PROTECTED]> wrote: > > > > If those operations involve modifying that slab page's pageframe then what > > > stops concurrent dma'ers from stomping on each other's changes? As

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Andrew Morton
On Fri, 29 Jun 2007 13:16:57 +0100 Alan Cox <[EMAIL PROTECTED]> wrote: > > If those operations involve modifying that slab page's pageframe then what > > stops concurrent dma'ers from stomping on each other's changes? As in: > > why aren't we already buggy? > > Or DMA operations falling out

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Fri, 29 Jun 2007, Hugh Dickins wrote: > I stand by my page_mapping patch, and the remark I made before, > that page_mapping(page) is the correct place to check this. What is > page_mapping(page) for? Precisely to return the struct address_space* > from page->mapping when that's what's in

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Hugh Dickins
On Thu, 28 Jun 2007, Christoph Lameter wrote: > I had a talk with James Bottomley last night and it seems that there is an > established way of using the page structs of slab objects in the block > layer. Drivers may use the DMA interfaces to issue control commands. In > that case they may

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Alan Cox
> If those operations involve modifying that slab page's pageframe then what > stops concurrent dma'ers from stomping on each other's changes? As in: > why aren't we already buggy? Or DMA operations falling out with CPU operations in the same memory area. Not all platforms have hardware

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread David Miller
From: Christoph Lameter <[EMAIL PROTECTED]> Date: Fri, 29 Jun 2007 00:00:39 -0700 (PDT) > On Thu, 28 Jun 2007, David Miller wrote: > > > Really, it would be great if we could treat kmalloc() objects > > just like real pages. Everything wants to do I/O on pages > > but sometimes (like the

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: > Really, it would be great if we could treat kmalloc() objects > just like real pages. Everything wants to do I/O on pages > but sometimes (like the networking) you have a kmalloc > chunk which is technically just a part of a page. > > The fact that

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Thu, 28 Jun 2007, Andrew Morton wrote: > If those operations _don't_ involve modifying the pageframe (hopes this is > true) then we're read-only and things become much easier? This is true right now. We are way off topic ... - To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: > From: Andrew Morton <[EMAIL PROTECTED]> > Date: Thu, 28 Jun 2007 22:24:24 -0700 > > > So what happens when two quite different threads of control are doing > > IO against two hunks of kmalloced memory which happen to come from the same > > page? Either

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: From: Andrew Morton [EMAIL PROTECTED] Date: Thu, 28 Jun 2007 22:24:24 -0700 So what happens when two quite different threads of control are doing IO against two hunks of kmalloced memory which happen to come from the same page? Either some

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Thu, 28 Jun 2007, Andrew Morton wrote: If those operations _don't_ involve modifying the pageframe (hopes this is true) then we're read-only and things become much easier? This is true right now. We are way off topic ... - To unsubscribe from this list: send the line unsubscribe

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: Really, it would be great if we could treat kmalloc() objects just like real pages. Everything wants to do I/O on pages but sometimes (like the networking) you have a kmalloc chunk which is technically just a part of a page. The fact that there is

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread David Miller
From: Christoph Lameter [EMAIL PROTECTED] Date: Fri, 29 Jun 2007 00:00:39 -0700 (PDT) On Thu, 28 Jun 2007, David Miller wrote: Really, it would be great if we could treat kmalloc() objects just like real pages. Everything wants to do I/O on pages but sometimes (like the networking) you

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Alan Cox
If those operations involve modifying that slab page's pageframe then what stops concurrent dma'ers from stomping on each other's changes? As in: why aren't we already buggy? Or DMA operations falling out with CPU operations in the same memory area. Not all platforms have hardware consistency

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Hugh Dickins
On Thu, 28 Jun 2007, Christoph Lameter wrote: I had a talk with James Bottomley last night and it seems that there is an established way of using the page structs of slab objects in the block layer. Drivers may use the DMA interfaces to issue control commands. In that case they may

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Christoph Lameter
On Fri, 29 Jun 2007, Hugh Dickins wrote: I stand by my page_mapping patch, and the remark I made before, that page_mapping(page) is the correct place to check this. What is page_mapping(page) for? Precisely to return the struct address_space* from page-mapping when that's what's in there,

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Andrew Morton
On Fri, 29 Jun 2007 13:16:57 +0100 Alan Cox [EMAIL PROTECTED] wrote: If those operations involve modifying that slab page's pageframe then what stops concurrent dma'ers from stomping on each other's changes? As in: why aren't we already buggy? Or DMA operations falling out with CPU

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Russell King
On Fri, Jun 29, 2007 at 01:45:29PM -0700, Andrew Morton wrote: On Fri, 29 Jun 2007 13:16:57 +0100 Alan Cox [EMAIL PROTECTED] wrote: If those operations involve modifying that slab page's pageframe then what stops concurrent dma'ers from stomping on each other's changes? As in: why

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Alan Cox
On Fri, 29 Jun 2007 13:45:29 -0700 Andrew Morton [EMAIL PROTECTED] wrote: On Fri, 29 Jun 2007 13:16:57 +0100 Alan Cox [EMAIL PROTECTED] wrote: If those operations involve modifying that slab page's pageframe then what stops concurrent dma'ers from stomping on each other's changes? As

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-29 Thread Alan Cox
DMA to or from memory should be done via the DMA mapping API. If we're DMAing to/from a limited range within a page, either we should be using dma_map_single(), or dma_map_page() with an appropriate offset and size. If those ranges overlap a cache line then the dma mapping API will not save

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Andrew Morton
On Thu, 28 Jun 2007 22:37:34 -0700 (PDT) David Miller <[EMAIL PROTECTED]> wrote: > From: Andrew Morton <[EMAIL PROTECTED]> > Date: Thu, 28 Jun 2007 22:24:24 -0700 > > > So what happens when two quite different threads of control are doing > > IO against two hunks of kmalloced memory which happen

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Andrew Morton <[EMAIL PROTECTED]> Date: Thu, 28 Jun 2007 22:24:24 -0700 > So what happens when two quite different threads of control are doing > IO against two hunks of kmalloced memory which happen to come from the same > page? Either some (kernel-wide) locking is needed, or that

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Andrew Morton
On Thu, 28 Jun 2007 22:06:06 -0700 (PDT) David Miller <[EMAIL PROTECTED]> wrote: > From: Christoph Lameter <[EMAIL PROTECTED]> > Date: Thu, 28 Jun 2007 21:39:01 -0700 (PDT) > > > H... Maybe we are creating more of a mess with this. Isnt there some > > other way to handle these object. > >

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Christoph Lameter <[EMAIL PROTECTED]> Date: Thu, 28 Jun 2007 21:39:01 -0700 (PDT) > H... Maybe we are creating more of a mess with this. Isnt there some > other way to handle these object. That's where I was going with the silly idea to use another allocator :) Really, it would be

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: > > You can get such a reference and then the slab page will be in limbo if > > all objects are freed until that reference is given up. The reference > > method is also use by kmem_cache_vacate() (but that is slab internal). > > What about if someone

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Christoph Lameter <[EMAIL PROTECTED]> Date: Thu, 28 Jun 2007 21:22:22 -0700 (PDT) > On Thu, 28 Jun 2007, David Miller wrote: > > > > Still a better solution would be to not use the slab allocator at all for > > > the objects that are used to send commands to the devices. These are not >

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: > > Still a better solution would be to not use the slab allocator at all for > > the objects that are used to send commands to the devices. These are not > > permanent and grabbing a page from the pcp lists and putting it back is > > likely as fast as

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Christoph Lameter <[EMAIL PROTECTED]> Date: Thu, 28 Jun 2007 21:01:36 -0700 (PDT) > Modify the functions in the affected arches to check for PageSlab() and > use a NULL mapping if such a page is encountered. This may only be > necessary for parisc and arm since sparc64 and xtensa do not

[PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Christoph Lameter
I had a talk with James Bottomley last night and it seems that there is an established way of using the page structs of slab objects in the block layer. Drivers may use the DMA interfaces to issue control commands. In that case they may allocate a short structure via the slab allocator and put

[PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Christoph Lameter
I had a talk with James Bottomley last night and it seems that there is an established way of using the page structs of slab objects in the block layer. Drivers may use the DMA interfaces to issue control commands. In that case they may allocate a short structure via the slab allocator and put

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Christoph Lameter [EMAIL PROTECTED] Date: Thu, 28 Jun 2007 21:01:36 -0700 (PDT) Modify the functions in the affected arches to check for PageSlab() and use a NULL mapping if such a page is encountered. This may only be necessary for parisc and arm since sparc64 and xtensa do not scan

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: Still a better solution would be to not use the slab allocator at all for the objects that are used to send commands to the devices. These are not permanent and grabbing a page from the pcp lists and putting it back is likely as fast as

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Christoph Lameter [EMAIL PROTECTED] Date: Thu, 28 Jun 2007 21:22:22 -0700 (PDT) On Thu, 28 Jun 2007, David Miller wrote: Still a better solution would be to not use the slab allocator at all for the objects that are used to send commands to the devices. These are not permanent

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Christoph Lameter
On Thu, 28 Jun 2007, David Miller wrote: You can get such a reference and then the slab page will be in limbo if all objects are freed until that reference is given up. The reference method is also use by kmem_cache_vacate() (but that is slab internal). What about if someone kfree()'s

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Christoph Lameter [EMAIL PROTECTED] Date: Thu, 28 Jun 2007 21:39:01 -0700 (PDT) H... Maybe we are creating more of a mess with this. Isnt there some other way to handle these object. That's where I was going with the silly idea to use another allocator :) Really, it would be great

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Andrew Morton
On Thu, 28 Jun 2007 22:06:06 -0700 (PDT) David Miller [EMAIL PROTECTED] wrote: From: Christoph Lameter [EMAIL PROTECTED] Date: Thu, 28 Jun 2007 21:39:01 -0700 (PDT) H... Maybe we are creating more of a mess with this. Isnt there some other way to handle these object. That's where

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread David Miller
From: Andrew Morton [EMAIL PROTECTED] Date: Thu, 28 Jun 2007 22:24:24 -0700 So what happens when two quite different threads of control are doing IO against two hunks of kmalloced memory which happen to come from the same page? Either some (kernel-wide) locking is needed, or that pageframe

Re: [PATCH] Containment measures for slab objects on scatter gather lists

2007-06-28 Thread Andrew Morton
On Thu, 28 Jun 2007 22:37:34 -0700 (PDT) David Miller [EMAIL PROTECTED] wrote: From: Andrew Morton [EMAIL PROTECTED] Date: Thu, 28 Jun 2007 22:24:24 -0700 So what happens when two quite different threads of control are doing IO against two hunks of kmalloced memory which happen to come