public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Peter Xu <peterx@redhat.com>, Juri Lelli <juri.lelli@redhat.com>
Subject: Re: [PATCH V3] sched/isolation: isolate from handling managed interrupt
Date: Mon, 20 Jan 2020 16:58:49 +0800	[thread overview]
Message-ID: <20200120085849.GA21740@ming.t460p> (raw)
In-Reply-To: <87ftgb4chi.fsf@nanos.tec.linutronix.de>

Hello Thomas,

On Sun, Jan 19, 2020 at 05:50:17PM +0100, Thomas Gleixner wrote:
> Ming,
> 
> Ming Lei <ming.lei@redhat.com> writes:
> >  
> > +static bool hk_should_isolate(struct irq_data *data,
> > +		const struct cpumask *affinity, unsigned int cpu)
> 
> Please align the first argument on the second line with the first
> argument on the first line.
> 
> > +{
> > +	const struct cpumask *hk_mask;
> > +
> > +	if (!housekeeping_enabled(HK_FLAG_MANAGED_IRQ))
> > +		return false;
> > +
> > +	if (!irqd_affinity_is_managed(data))
> > +		return false;
> 
> Pointless. That's already checked at the begin of the calling function.
> 
> > +
> > +	if (!cpumask_test_cpu(cpu, affinity))
> > +		return false;
> 
> Ditto.
> 
> > +	hk_mask = housekeeping_cpumask(HK_FLAG_MANAGED_IRQ);
> > +	if (cpumask_subset(affinity, hk_mask))
> > +		return false;
> > +
> > +	if (cpumask_intersects(irq_data_get_effective_affinity_mask(data),
> > +				hk_mask))
> 
> I really had to think twice why this is correct. The example I gave you
> is far more intuitive. It's just missing the check below.

Your example uses isolation mask, which has to be allocated and built
from housekeeping_cpumask(HK_FLAG_MANAGED_IRQ), that is why I use the
above way so that we can avoid the allocation.

IMO, the above is intuitive too, given it can be thought as effective
affinity including hk CPUs.

Thanks,
Ming


      reply	other threads:[~2020-01-20  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-18 12:53 [PATCH V3] sched/isolation: isolate from handling managed interrupt Ming Lei
2020-01-19 16:50 ` Thomas Gleixner
2020-01-20  8:58   ` Ming Lei [this message]

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=20200120085849.GA21740@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterx@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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