[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170118181520.GB17135@dhcp22.suse.cz>
Date: Wed, 18 Jan 2017 19:15:21 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Tim Chen <tim.c.chen@...ux.intel.com>
Cc: "Huang, Ying" <ying.huang@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
dave.hansen@...el.com, ak@...ux.intel.com, aaron.lu@...el.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Hugh Dickins <hughd@...gle.com>, Shaohua Li <shli@...nel.org>,
Minchan Kim <minchan@...nel.org>,
Rik van Riel <riel@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Johannes Weiner <hannes@...xchg.org>,
Hillf Danton <hillf.zj@...baba-inc.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
Jonathan Corbet <corbet@....net>,
Tim C Chen <tim.c.chen@...el.com>
Subject: Re: [Update][PATCH v5 7/9] mm/swap: Add cache for swap slots
allocation
On Wed 18-01-17 10:03:27, Tim Chen wrote:
> On Wed, Jan 18, 2017 at 01:45:55PM +0100, Michal Hocko wrote:
> > On Tue 17-01-17 13:42:35, Tim Chen wrote:
> > [...]
> > > Logic wise, We do allow pre-emption as per cpu ptr cache->slots is
> > > protected by the mutex cache->alloc_lock. We switch the
> > > inappropriately used this_cpu_ptr to raw_cpu_ptr for per cpu ptr
> > > access of cache->slots.
> >
> > OK, that looks better. I would still appreciate something like the
> > following folded in
> > diff --git a/include/linux/swap_slots.h b/include/linux/swap_slots.h
> > index fb907346c5c6..0afe748453a7 100644
> > --- a/include/linux/swap_slots.h
> > +++ b/include/linux/swap_slots.h
> > @@ -11,6 +11,7 @@
> >
> > struct swap_slots_cache {
> > bool lock_initialized;
> > + /* protects slots, nr, cur */
> > struct mutex alloc_lock;
> > swp_entry_t *slots;
> > int nr;
> >
>
> I've included here a patch for the comments.
Thanks!
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists