Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1697525

Re: [RFC PATCH] mm/slub: fix a deadlock due to incomplete patching of cpusets_enabled()

From Dima Zavin <dmitriyz@waymo.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH] mm/slub: fix a deadlock due to incomplete patching of cpusets_enabled()
Date 2017-07-26 22:00 +0200
Message-ID <u7ADo-4Bn-17@gated-at.bofh.it> (permalink)
References <u7xPb-2P1-11@gated-at.bofh.it> <u7xYS-37A-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jul 26, 2017 at 10:02 AM, Christopher Lameter <cl@linux.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?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH] mm/slub: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-26 19:00 +0200
  Re: [RFC PATCH] mm/slub: fix a deadlock due to incomplete patching  of cpusets_enabled() Christopher Lameter <cl@linux.com> - 2017-07-26 19:10 +0200
    Re: [RFC PATCH] mm/slub: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-26 22:00 +0200
    [PATCH v2] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-27 18:50 +0200
      Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of  cpusets_enabled() Andrew Morton <akpm@linux-foundation.org> - 2017-07-27 21:50 +0200
        Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-27 23:50 +0200
      Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of  cpusets_enabled() Andrew Morton <akpm@linux-foundation.org> - 2017-07-27 22:00 +0200
        Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-27 23:50 +0200
      Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of  cpusets_enabled() Vlastimil Babka <vbabka@suse.cz> - 2017-07-28 09:50 +0200
        Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-28 10:50 +0200
        Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of  cpusets_enabled() Peter Zijlstra <peterz@infradead.org> - 2017-07-28 11:40 +0200
          Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of  cpusets_enabled() Vlastimil Babka <vbabka@suse.cz> - 2017-07-28 16:10 +0200
            Re: [PATCH v2] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-28 19:00 +0200
            [PATCH v3] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-31 06:10 +0200
              Re: [PATCH v3] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-31 06:10 +0200
              Re: [PATCH v3] cpuset: fix a deadlock due to incomplete patching of  cpusets_enabled() Vlastimil Babka <vbabka@suse.cz> - 2017-07-31 10:10 +0200
                Re: [PATCH v3] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Dima Zavin <dmitriyz@waymo.com> - 2017-07-31 11:10 +0200

csiph-web