The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Pranjal Shrivastava <praan@google.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Nicolin Chen <nicolinc@nvidia.com>, Will Deacon <will@kernel.org>,
	Kuan-Wei Chiu <visitorckw@gmail.com>,
	joro@8bytes.org, akpm@linux-foundation.org, cychu@google.com,
	hhchung@google.com, amitamishra@google.com, marscheng@google.com,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, jserv@ccns.ncku.edu.tw,
	eleanor15x@gmail.com
Subject: Re: [PATCH 1/2] iommu/arm-smmu-v3: Replace sort_nonatomic() with sort()
Date: Mon, 3 Aug 2026 13:37:16 +0000	[thread overview]
Message-ID: <anCZjMybqHA2n13e@google.com> (raw)
In-Reply-To: <00dae86e-cbc3-4d6e-966f-39afd4b8c2ec@arm.com>

On Mon, Aug 03, 2026 at 01:35:52PM +0100, Robin Murphy wrote:
> On 02/08/2026 6:45 pm, Nicolin Chen wrote:
> > On Sun, Aug 02, 2026 at 10:23:48AM +0100, Will Deacon wrote:
> > > On Thu, Jul 30, 2026 at 06:12:15PM +0000, Kuan-Wei Chiu wrote:
> > > > @@ -4047,9 +4047,9 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
> > > >   	}
> > > >   	/* Put the ids into order for sorted to_merge/to_unref arrays */
> > > > -	sort_nonatomic(master->streams, master->num_streams,
> > > > -		       sizeof(master->streams[0]), arm_smmu_stream_id_cmp,
> > > > -		       NULL);
> > > > +	sort(master->streams, master->num_streams,
> > > > +	     sizeof(master->streams[0]), arm_smmu_stream_id_cmp,
> > > > +	     NULL);
> > > 
> > > Makes sense to me. Nicolin, did you choose the nonatomic version
> > > specifically?
> > 
> > It's probably rare to have a large multi-stream array, so I think
> > sort() would be fine.
> 
> Yeah, probably 99% of the time the size of this array will be 1. An
> exceptional value of "large" might be something like 64 for a massive
> (non-PCI) DMA engine with separate read and write IDs per channel for no
> good reason.
> 
> If and when someone ever were to report RCU stalls here then we can first
> ask them what the heck their client device is... and unless and until then I
> wouldn't think it's worth worrying about.
> 

+1. Agreed, it should be fine to use sort() here..

> Thanks,
> Robin.
> 

Thanks,
Praan

  reply	other threads:[~2026-08-03 13:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 18:12 [PATCH 0/2] lib/sort: Clean up sort_nonatomic() and sort_r_nonatomic() Kuan-Wei Chiu
2026-07-30 18:12 ` [PATCH 1/2] iommu/arm-smmu-v3: Replace sort_nonatomic() with sort() Kuan-Wei Chiu
2026-08-02  9:23   ` Will Deacon
2026-08-02 17:45     ` Nicolin Chen
2026-08-03 12:35       ` Robin Murphy
2026-08-03 13:37         ` Pranjal Shrivastava [this message]
2026-07-30 18:12 ` [PATCH 2/2] Revert "lib/sort.c: add _nonatomic() variants with cond_resched()" Kuan-Wei Chiu
2026-07-30 19:32 ` [PATCH 0/2] lib/sort: Clean up sort_nonatomic() and sort_r_nonatomic() Kuan-Wei Chiu

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=anCZjMybqHA2n13e@google.com \
    --to=praan@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=amitamishra@google.com \
    --cc=cychu@google.com \
    --cc=eleanor15x@gmail.com \
    --cc=hhchung@google.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marscheng@google.com \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=visitorckw@gmail.com \
    --cc=will@kernel.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