Hi, Fenghua
I got an issue when testing nginx with 5.18-rc1/2 on aarch64 system,
After debugging I found it is caused by this patchset.
In the test, when accessing https, crypto driver will be used with sva feature,
and nginx is testing multi-threads.
Test cmd:
sudo sbin/nginx
lynx https://localhost
sudo sbin/nginx -s quit
Before this patchset, ioasid is kept ioasid=1 after sbin/nginx until quit.
And new ioasid is alloc ioasid=2 when testing lynx.
ioasid=1 is freed when sbin/nginx -s quit.
with this patchset, each time after sbin/nginx, ioasid is freed
immediately.
lynx test will alloc the same ioasid=1.
To verify, hack comment mm_pasid_drop in __mmput will make the issue
disappear.
log: after sbin/nginx.
[ 96.526730] Call trace:
[ 96.526732] dump_backtrace+0xe4/0xf0
[ 96.526741] show_stack+0x20/0x70
[ 96.526744] dump_stack_lvl+0x8c/0xb8
[ 96.526751] dump_stack+0x18/0x34
[ 96.526754] ioasid_free+0xdc/0xfc
[ 96.526757] mmput+0x138/0x160
[ 96.526760] do_exit+0x284/0x9d0
[ 96.526765] do_group_exit+0x3c/0xa8
[ 96.526767] __wake_up_parent+0x0/0x38
[ 96.526770] invoke_syscall+0x4c/0x110
[ 96.526775] el0_svc_common.constprop.0+0x68/0x128
[ 96.526778] do_el0_svc+0x2c/0x90
[ 96.526781] el0_svc+0x30/0x98
[ 96.526783] el0t_64_sync_handler+0xb0/0xb8
[ 96.526785] el0t_64_sync+0x18c/0x190
I am still in checking.
Thanks
------------------ Original ------------------
From:
"Joerg Roedel"
<j...@8bytes.org>;
Date: Tue, Feb 15, 2022 05:55 PM
To: "Fenghua Yu"<fenghua...@intel.com>;
Cc: "Ravi V Shankar"<ravi.v.shan...@intel.com>;"Tony
Luck"<tony.l...@intel.com>;"Ashok Raj"<ashok....@intel.com>;"Peter
Zijlstra"<pet...@infradead.org>;"Dave
Hansen"<dave.han...@linux.intel.com>;"x86"<x...@kernel.org>;"linux-kernel"<linux-ker...@vger.kernel.org>;"iommu"<iommu@lists.linux-foundation.org>;"Ingo
Molnar"<mi...@redhat.com>;"Borislav Petkov"<b...@alien8.de>;"Andy
Lutomirski"<l...@kernel.org>;"Josh
Poimboeuf"<jpoim...@redhat.com>;"Thomas Gleixner"<t...@linutronix.de>;
Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID
allocation and free it on mm exit
On Mon, Feb 07, 2022 at 03:02:48PM -0800, Fenghua Yu wrote:
> PASIDs are process wide. It was attempted to use refcounted PASIDs to
> free them when the last thread drops the refcount. This turned out to
> be complex and error prone. Given the fact that the PASID space is 20
> bits, which allows up to 1M processes to have a PASID associated
> concurrently, PASID resource exhaustion is not a realistic concern.
>
> Therefore it was decided to simplify the approach and stick with lazy
> on demand PASID allocation, but drop the eager free approach and make
> a allocated PASID lifetime bound to the life time of the process.
>
> Get rid of the refcounting mechanisms and replace/rename the interfaces
> to reflect this new approach.
>
> Suggested-by: Dave Hansen <dave.han...@linux.intel.com>
> Signed-off-by: Fenghua Yu <fenghua...@intel.com>
> Reviewed-by: Tony Luck <tony.l...@intel.com>
Acked-by: Joerg Roedel <jroe...@suse.de>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu