[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190312184754.GB31407@tower.DHCP.thefacebook.com>
Date: Tue, 12 Mar 2019 18:47:57 +0000
From: Roman Gushchin <guro@...com>
To: Christopher Lameter <cl@...ux.com>
CC: "Tobin C. Harding" <tobin@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Pekka Enberg <penberg@...helsinki.fi>,
"Matthew Wilcox" <willy@...radead.org>,
Tycho Andersen <tycho@...ho.ws>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC 02/15] slub: Add isolate() and migrate() methods
On Tue, Mar 12, 2019 at 04:35:15AM +0000, Christopher Lameter wrote:
> On Mon, 11 Mar 2019, Roman Gushchin wrote:
>
> > > --- a/mm/slub.c
> > > +++ b/mm/slub.c
> > > @@ -4325,6 +4325,34 @@ int __kmem_cache_create(struct kmem_cache *s, slab_flags_t flags)
> > > return err;
> > > }
> > >
> > > +void kmem_cache_setup_mobility(struct kmem_cache *s,
> > > + kmem_cache_isolate_func isolate,
> > > + kmem_cache_migrate_func migrate)
> > > +{
> >
> > I wonder if it's better to adapt kmem_cache_create() to take two additional
> > argument? I suspect mobility is not a dynamic option, so it can be
> > set on kmem_cache creation.
>
> One other idea that prior versions of this patchset used was to change
> kmem_cache_create() so that the ctor parameter becomes an ops vector.
>
> However, in order to reduce the size of the patchset I dropped that. It
> could be easily moved back to the way it was before.
Understood. I like the idea of an ops vector, but it can be done later,
agree.
>
> > > + /*
> > > + * Sadly serialization requirements currently mean that we have
> > > + * to disable fast cmpxchg based processing.
> > > + */
> >
> > Can you, please, elaborate a bit more here?
>
> cmpxchg based processing does not lock the struct page. SMO requires to
> ensure that all changes on a slab page can be stopped. The page->lock will
> accomplish that. I think we could avoid dealing with actually locking the
> page with some more work.
Thank you for the explanation!
Powered by blists - more mailing lists