linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jules Irenge <jbi.octave@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: boqun.feng@gmail.com, Thomas Gleixner <tglx@linutronix.de>,
	Jiri Kosina <jkosina@suse.cz>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Ingo Molnar <mingo@kernel.org>, Qian Cai <cai@lca.pw>,
	Eiichi Tsukata <devel@etsukata.com>,
	Pavankumar Kondeti <pkondeti@codeaurora.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Tyler Hicks <tyhicks@canonical.com>
Subject: [PATCH 1/1] cpu: Add annotation inside clear_tasks_mm_cpumask()
Date: Wed, 15 Apr 2020 19:49:37 +0100	[thread overview]
Message-ID: <20200415184937.32373-2-jbi.octave@gmail.com> (raw)
In-Reply-To: <20200415184937.32373-1-jbi.octave@gmail.com>

Sparse reports a warning

warning: context imbalance in clear_tasks_mm_cpumask() - different lock contexts for basic block

The root cause is the missing annotation inside clear_tasks_mm_cpumask()

Add the missing __acquire(&t->alloc_lock) annotation.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 kernel/cpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 9c706af713fb..d8c452a8dd09 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -834,6 +834,7 @@ void clear_tasks_mm_cpumask(int cpu)
 		t = find_lock_task_mm(p);
 		if (!t)
 			continue;
+		__acquire(&t->alloc_lock);
 		cpumask_clear_cpu(cpu, mm_cpumask(t->mm));
 		task_unlock(t);
 	}
-- 
2.24.1


  reply	other threads:[~2020-04-15 19:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 18:49 [PATCH 0/1] Fix context imbalance warning Jules Irenge
2020-04-15 18:49 ` Jules Irenge [this message]
2020-04-15 22:25   ` [PATCH 1/1] cpu: Add annotation inside clear_tasks_mm_cpumask() Peter Zijlstra

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=20200415184937.32373-2-jbi.octave@gmail.com \
    --to=jbi.octave@gmail.com \
    --cc=arnd@arndb.de \
    --cc=boqun.feng@gmail.com \
    --cc=cai@lca.pw \
    --cc=devel@etsukata.com \
    --cc=jkosina@suse.cz \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pkondeti@codeaurora.org \
    --cc=tglx@linutronix.de \
    --cc=tyhicks@canonical.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).