linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dou Liyang <douliyangs@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kashyap.desai@broadcom.com,
	shivasharan.srikanteshwara@broadcom.com,
	sumit.saxena@broadcom.com, ming.lei@redhat.com,
	Christoph Hellwig <hch@lst.de>,
	bhelgaas@google.com, linux-pci@vger.kernel.org
Subject: Re: [RFC PATCH v3] genirq/affinity: Create and transfer more irq desc info by a new structure
Date: Thu, 29 Nov 2018 22:49:54 +0800	[thread overview]
Message-ID: <0aaa0eeb-2c8e-71e2-bf92-87103735b2b6@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1811282228570.1879@nanos.tec.linutronix.de>

Hi Thomas,

On 2018/11/29 6:03, Thomas Gleixner wrote:

>> +		affi_desc = kcalloc(nvec, sizeof(*affi_desc), GFP_KERNEL);
> 
> Why do you want to do that separate allocation here? Just let

I thought the irq_create_affinity_desc() also can be called by other 
functions which may convert cpumasks to irq_affinity_desc, such as
__devm_irq_alloc_descs().

Now, I know I was wrong, will modify it.

> irq_create_affinity_masks() allocate an array of affinity descriptors and
> use that. There is no point in copying that stuff over and over. Setting
> the flag field can be done in the existing function as well.

> Can you please change the function signature and fixup the callers, if
> there are any of them? Copying this over and over is horrible.

I have searched, no one calls __devm_irq_alloc_descs, it may be called
by some users' own modules or drives.

yes, I will change it.

> struct irq_affinity_desc {
> 	struct cpumask	masks;
> 	unsigned int	managed : 1; > };

yes, BTW, If the following is more fit for irq_affinity_desc:

s/masks/mask/
s/managed/is_managed/

> 

> You can spare a lot of pointless churn by just keeping the 'affinity' name
> and only changing the struct type. The compiler will catch all places which
> need to be fixed and 'affinity' is generic enough to be used with the new
> struct type as well. As Bjorn said, even 'masks' is fine.

Yes, I see

Thanks,
	dou

      reply	other threads:[~2018-11-29 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28 16:45 [RFC PATCH v3] genirq/affinity: Create and transfer more irq desc info by a new structure Dou Liyang
2018-11-28 20:00 ` Bjorn Helgaas
2018-11-28 21:28   ` Thomas Gleixner
2018-11-29 14:30   ` Dou Liyang
2018-11-28 22:03 ` Thomas Gleixner
2018-11-29 14:49   ` Dou Liyang [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=0aaa0eeb-2c8e-71e2-bf92-87103735b2b6@gmail.com \
    --to=douliyangs@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=hch@lst.de \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=shivasharan.srikanteshwara@broadcom.com \
    --cc=sumit.saxena@broadcom.com \
    --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;
as well as URLs for NNTP newsgroup(s).