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&gt;;
Date:&nbsp;Tue, Feb 15, 2022 05:55 PM
To:&nbsp;"Fenghua Yu"<fenghua...@intel.com&gt;;
Cc:&nbsp;"Ravi V Shankar"<ravi.v.shan...@intel.com&gt;;"Tony 
Luck"<tony.l...@intel.com&gt;;"Ashok Raj"<ashok....@intel.com&gt;;"Peter 
Zijlstra"<pet...@infradead.org&gt;;"Dave 
Hansen"<dave.han...@linux.intel.com&gt;;"x86"<x...@kernel.org&gt;;"linux-kernel"<linux-ker...@vger.kernel.org&gt;;"iommu"<iommu@lists.linux-foundation.org&gt;;"Ingo
 Molnar"<mi...@redhat.com&gt;;"Borislav Petkov"<b...@alien8.de&gt;;"Andy 
Lutomirski"<l...@kernel.org&gt;;"Josh 
Poimboeuf"<jpoim...@redhat.com&gt;;"Thomas Gleixner"<t...@linutronix.de&gt;;
Subject:&nbsp;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:
&gt; PASIDs are process wide. It was attempted to use refcounted PASIDs to
&gt; free them when the last thread drops the refcount. This turned out to
&gt; be complex and error prone. Given the fact that the PASID space is 20
&gt; bits, which allows up to 1M processes to have a PASID associated
&gt; concurrently, PASID resource exhaustion is not a realistic concern.
&gt; 
&gt; Therefore it was decided to simplify the approach and stick with lazy
&gt; on demand PASID allocation, but drop the eager free approach and make
&gt; a allocated PASID lifetime bound to the life time of the process.
&gt; 
&gt; Get rid of the refcounting mechanisms and replace/rename the interfaces
&gt; to reflect this new approach.
&gt; 
&gt; Suggested-by: Dave Hansen <dave.han...@linux.intel.com&gt;
&gt; Signed-off-by: Fenghua Yu <fenghua...@intel.com&gt;
&gt; Reviewed-by: Tony Luck <tony.l...@intel.com&gt;

Acked-by: Joerg Roedel <jroe...@suse.de&gt;

_______________________________________________
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

Reply via email to