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"                     
                                                               
<[email protected]&gt;;
Date:&nbsp;Tue, Feb 15, 2022 05:55 PM
To:&nbsp;"Fenghua Yu"<[email protected]&gt;;
Cc:&nbsp;"Ravi V Shankar"<[email protected]&gt;;"Tony 
Luck"<[email protected]&gt;;"Ashok Raj"<[email protected]&gt;;"Peter 
Zijlstra"<[email protected]&gt;;"Dave 
Hansen"<[email protected]&gt;;"x86"<[email protected]&gt;;"linux-kernel"<[email protected]&gt;;"iommu"<[email protected]&gt;;"Ingo
 Molnar"<[email protected]&gt;;"Borislav Petkov"<[email protected]&gt;;"Andy 
Lutomirski"<[email protected]&gt;;"Josh 
Poimboeuf"<[email protected]&gt;;"Thomas Gleixner"<[email protected]&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 <[email protected]&gt;
&gt; Signed-off-by: Fenghua Yu <[email protected]&gt;
&gt; Reviewed-by: Tony Luck <[email protected]&gt;

Acked-by: Joerg Roedel <[email protected]&gt;

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to