Netdev List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"arjan@linux.jf.intel.com" <arjan@linux.jf.intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH linux-next v2 1/2] irq: Add CPU mask affinity hint
Date: Fri, 30 Apr 2010 21:04:42 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1004302038140.2951@localhost.localdomain> (raw)
In-Reply-To: <Pine.WNT.4.64.1004301059230.6264@PPWASKIE-MOBL2.amr.corp.intel.com>

On Fri, 30 Apr 2010, Peter P Waskiewicz Jr wrote:
> On Fri, 30 Apr 2010, Thomas Gleixner wrote:
> > > +extern int irq_register_affinity_hint(unsigned int irq,
> > > +                                      const struct cpumask *m);
> > 
> > I think we can do with a single funtion irq_set_affinity_hint() and
> > let the caller set the pointer to NULL.
> 
> Ok, I've been running into some issues.  If CONFIG_CPUMASK_OFFSTACK is not
> set, then cpumask_var_t structs are single-element arrays that cannot be
> NULL'd out.  I'm pretty sure I need to keep the unregister part of the API.
> Thoughts?

extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);

So why should calling irq_set_affinity_hint(irqnr, NULL) not work ?
 
> I just looked at the original show_affinity function, and it does not grab
> desc->lock before copying mask out of desc.  Should I follow that model, or
> should I fix that function to honor desc->lock?

desc->affinity can only race against something changing the affinity
bits, so that just might return some random data.

In the hint case the irq could be shut down and the affinity hint
could be freed while you are accessing it. Not a good idea :)

Thanks,

	tglx

  reply	other threads:[~2010-04-30 19:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30  8:51 [PATCH linux-next v2 1/2] irq: Add CPU mask affinity hint Peter P Waskiewicz Jr
2010-04-30  8:52 ` [PATCH linux-next v2 2/2] ixgbe: Example usage of the new IRQ affinity_hint callback Peter P Waskiewicz Jr
2010-04-30 10:53 ` [PATCH linux-next v2 1/2] irq: Add CPU mask affinity hint Thomas Gleixner
2010-04-30 16:41   ` Peter P Waskiewicz Jr
2010-04-30 18:02   ` Peter P Waskiewicz Jr
2010-04-30 19:04     ` Thomas Gleixner [this message]
2010-04-30 19:13       ` Peter P Waskiewicz Jr

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.LFD.2.00.1004302038140.2951@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=arjan@linux.jf.intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.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