lkml.org 
[lkml]   [2022]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCHES 1/2] iommu: Add RCU-protected page free support
From
On 2022/6/9 20:49, Jason Gunthorpe wrote:
>> +void iommu_free_pgtbl_pages(struct iommu_domain *domain,
>> + struct list_head *pages)
>> +{
>> + struct page *page, *next;
>> +
>> + if (!domain->concurrent_traversal) {
>> + put_pages_list(pages);
>> + return;
>> + }
>> +
>> + list_for_each_entry_safe(page, next, pages, lru) {
>> + list_del(&page->lru);
>> + call_rcu(&page->rcu_head, pgtble_page_free_rcu);
>> + }
> It seems OK, but I wonder if there is benifit to using
> put_pages_list() from the rcu callback

The price is that we need to allocate a "struct list_head" and free it
in the rcu callback as well. Currently the list_head is sitting in the
stack.

Best regards,
baolu

\
 
 \ /
  Last update: 2022-06-10 07:37    [W:1.978 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site