From: Andi Kleen <ak@linux.intel.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Waiman Long <longman@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@kernel.org>
Subject: Re: [PATCH v2] hugetlbfs: Disable softIRQ when taking hugetlb_lock
Date: Thu, 12 Dec 2019 13:32:39 -0800 [thread overview]
Message-ID: <871rt99qmg.fsf@linux.intel.com> (raw)
In-Reply-To: <20191212060650.ftqq27ftutxpc5hq@linux-p48b> (Davidlohr Bueso's message of "Wed, 11 Dec 2019 22:06:50 -0800")
Davidlohr Bueso <dave@stgolabs.net> writes:
> +void free_huge_page(struct page *page)
> +{
> + struct hugetlb_free_page_work work;
> +
> + work.page = page;
> + INIT_WORK_ONSTACK(&work.work, free_huge_page_workfn);
> + queue_work(hugetlb_free_page_wq, &work.work);
> +
> + /*
> + * Wait until free_huge_page is done.
> + */
> + flush_work(&work.work);
> + destroy_work_on_stack(&work.work);
Does flushing really work in softirq context?
Anyways, waiting seems inefficient over fire'n'forget
You'll need a per cpu pre allocated work item and a queue.
Then take a lock on the the queue and link the page into
it and trigger the work item if it's not already pending.
And add a in_interrupt() check of course.
-Andi
next prev parent reply other threads:[~2019-12-12 21:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 19:46 [PATCH v2] hugetlbfs: Disable softIRQ when taking hugetlb_lock Waiman Long
2019-12-11 22:04 ` Mike Kravetz
2019-12-11 22:19 ` Waiman Long
2019-12-12 1:11 ` Mike Kravetz
2019-12-12 6:06 ` Davidlohr Bueso
2019-12-12 6:30 ` Davidlohr Bueso
2019-12-12 19:04 ` [PATCH v2] mm/hugetlb: defer free_huge_page() to a workqueue Davidlohr Bueso
2019-12-12 19:22 ` Mike Kravetz
2019-12-12 19:36 ` Davidlohr Bueso
2019-12-12 20:52 ` Waiman Long
2019-12-12 21:04 ` Waiman Long
2019-12-16 13:26 ` Michal Hocko
2019-12-16 15:38 ` Waiman Long
2019-12-16 18:44 ` Waiman Long
2019-12-17 9:00 ` Michal Hocko
2019-12-17 18:05 ` Mike Kravetz
2019-12-18 12:18 ` hugetlbfs testing coverage (was: Re: [PATCH v2] mm/hugetlb: defer free_huge_page() to a workqueue) Michal Hocko
2019-12-12 21:01 ` [PATCH v2] mm/hugetlb: defer free_huge_page() to a workqueue Waiman Long
2019-12-16 13:37 ` Michal Hocko
2019-12-16 16:17 ` Waiman Long
2019-12-16 16:17 ` Davidlohr Bueso
2019-12-16 17:18 ` Matthew Wilcox
2019-12-16 19:08 ` Mike Kravetz
2019-12-16 19:13 ` Waiman Long
2019-12-12 21:32 ` Andi Kleen [this message]
2019-12-12 22:42 ` [PATCH v2] hugetlbfs: Disable softIRQ when taking hugetlb_lock Davidlohr Bueso
2019-12-11 23:05 ` Andi Kleen
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=871rt99qmg.fsf@linux.intel.com \
--to=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=longman@redhat.com \
--cc=mhocko@kernel.org \
--cc=mike.kravetz@oracle.com \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).