[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPz4a6DWohW+vjnvQLh2DNrVrn9CUQ3HNuZ+2fKZJkRc+hXq3w@mail.gmail.com>
Date: Wed, 26 Jul 2017 12:54:44 -0700
From: Dima Zavin <dmitriyz@...mo.com>
To: Christopher Lameter <cl@...ux.com>
Cc: Mel Gorman <mgorman@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Li Zefan <lizefan@...wei.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>, cgroups@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org,
Cliff Spradlin <cspradlin@...mo.com>
Subject: Re: [RFC PATCH] mm/slub: fix a deadlock due to incomplete patching of cpusets_enabled()
On Wed, Jul 26, 2017 at 10:02 AM, Christopher Lameter <cl@...ux.com> wrote:
> On Wed, 26 Jul 2017, Dima Zavin wrote:
>
>> The fix is to cache the value that's returned by cpusets_enabled() at the
>> top of the loop, and only operate on the seqlock (both begin and retry) if
>> it was true.
>
> I think the proper fix would be to ensure that the calls to
> read_mems_allowed_{begin,retry} cannot cause the deadlock. Otherwise you
> have to fix this in multiple places.
>
> Maybe read_mems_allowed_* can do some form of synchronization or *_retry
> can implictly rely on the results of cpusets_enabled() by *_begin?
>
(res-ending because gmail hates me, sorry).
Thanks for the quick reply!
I can turn the cookie into a uint64, put the sequence into the low
order 32 bits and put the enabled state into bit 33 (or 63 :) ). Then
retry will not query cpusets_enabled() and will just look at the
enabled bit. This means that *_retry will always have a conditional
jump (i.e. lose the whole static_branch optimization) but maybe that's
ok since that's pretty rare and the *_begin() will still benefit from
it?
Powered by blists - more mailing lists