All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Guenter Roeck <linux@roeck-us.net>,
	Chris Metcalf <chris.d.metcalf@gmail.com>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Tejun Heo <tj@kernel.org>, linux-mm <linux-mm@kvack.org>
Subject: Re: linux-next: tracebacks in workqueue.c/__flush_work()
Date: Mon, 04 Feb 2019 10:16:12 +1030	[thread overview]
Message-ID: <87munc306z.fsf@rustcorp.com.au> (raw)
In-Reply-To: <72e7d782-85f2-b499-8614-9e3498106569@i-love.sakura.ne.jp>

Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> writes:
> (Adding Chris Metcalf and Rusty Russell.)
>
> If NR_CPUS == 1 due to CONFIG_SMP=n, for_each_cpu(cpu, &has_work) loop does not
> evaluate "struct cpumask has_work" modified by cpumask_set_cpu(cpu, &has_work) at
> previous for_each_online_cpu() loop. Guenter Roeck found a problem among three
> commits listed below.
>
>   Commit 5fbc461636c32efd ("mm: make lru_add_drain_all() selective")
>   expects that has_work is evaluated by for_each_cpu().
>
>   Commit 2d3854a37e8b767a ("cpumask: introduce new API, without changing anything")
>   assumes that for_each_cpu() does not need to evaluate has_work.
>
>   Commit 4d43d395fed12463 ("workqueue: Try to catch flush_work() without INIT_WORK().")
>   expects that has_work is evaluated by for_each_cpu().
>
> What should we do? Do we explicitly evaluate has_mask if NR_CPUS == 1 ?

No, fix the API to be least-surprise.  Fix 2d3854a37e8b767a too.

Doing anything else would be horrible, IMHO.

Cheers,
Rusty.

  reply	other threads:[~2019-02-06  1:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-02 22:20 Guenter Roeck
2019-02-03  1:21 ` Tetsuo Handa
2019-02-03 23:46   ` Rusty Russell [this message]
2019-02-06  6:31     ` Tetsuo Handa
2019-02-06 14:36       ` Guenter Roeck
2019-02-06 14:57         ` Tetsuo Handa
2019-02-06 16:23           ` Guenter Roeck
2019-02-06 16:38             ` Tetsuo Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87munc306z.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=chris.d.metcalf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@roeck-us.net \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=tj@kernel.org \
    --subject='Re: linux-next: tracebacks in workqueue.c/__flush_work()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.