linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Mike Galbraith <efault@gmx.de>, Ingo Molnar <mingo@elte.hu>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: tip: demise of tsk_cpus_allowed() and tsk_nr_cpus_allowed()
Date: Wed, 8 Feb 2017 11:20:19 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1702081107450.3536@nanos> (raw)
In-Reply-To: <20170206222313.GA6061@gmail.com>

On Mon, 6 Feb 2017, Ingo Molnar wrote:
> * Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > cpumasks are a pain, the above avoids allocating more of them.

Indeed.

> Yeah, so this could then be done by pointerifying ->cpus_allowed - more robust 
> than the wrappery,

You mean:

struct task_struct {
       cpumask_t	cpus_allowed;
       cpumask_t	*effective_cpus_allowed;
};

and make the scheduler use effective_cpus_allowed instead of cpus_allowed?
Or what do you have in mind?

> because as I've noted in the changelog there's a large body of 
> upstream code that does not use the wrappers but uses ->cpus_allowed directly:

Right and we really should audit those places. I bet that half of them are
just broken and evil hacks.

The wrapper we added is just covering the core scheduler code where the
information really matters for decision, but leaves the other oddball cases
alone.

The extra pointer might be a nicer concept, but it still has the same issue
as the wrapper. How do we enforce that random code accesses the right
thing?

Thanks,

	tglx

  reply	other threads:[~2017-02-08 11:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06  4:23 tip: demise of tsk_cpus_allowed() and tsk_nr_cpus_allowed() Mike Galbraith
2017-02-06 10:31 ` Ingo Molnar
2017-02-06 12:18   ` Mike Galbraith
2017-02-06 12:29     ` Ingo Molnar
2017-02-06 12:47       ` Mike Galbraith
2017-02-06 13:32       ` Peter Zijlstra
2017-02-06 22:23         ` Ingo Molnar
2017-02-08 10:20           ` Thomas Gleixner [this message]
2017-02-08 11:40             ` Peter Zijlstra
2017-02-09  6:45               ` Ingo Molnar
2017-02-09  6:57                 ` Ingo Molnar
2017-02-09  8:51                   ` Peter Zijlstra
2017-02-09  8:59                   ` Thomas Gleixner

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=alpine.DEB.2.20.1702081107450.3536@nanos \
    --to=tglx@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /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).