Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1450999
| From | hejianet <hejianet@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH] mm/hugetlb: Avoid soft lockup in set_max_huge_pages() |
| Date | 2016-07-27 03:50 +0200 |
| Message-ID | <rZm8V-1gn-7@gated-at.bofh.it> (permalink) |
| References | <rZcMi-3It-21@gated-at.bofh.it> <rZcVX-3LJ-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Dave
On 7/26/16 11:58 PM, Dave Hansen wrote:
> On 07/26/2016 08:44 AM, Jia He wrote:
>> This patch is to fix such soft lockup. I thouhgt it is safe to call
>> cond_resched() because alloc_fresh_gigantic_page and alloc_fresh_huge_page
>> are out of spin_lock/unlock section.
> Yikes. So the call site for both the things you patch is this:
>
>> while (count > persistent_huge_pages(h)) {
> ...
>> spin_unlock(&hugetlb_lock);
>> if (hstate_is_gigantic(h))
>> ret = alloc_fresh_gigantic_page(h, nodes_allowed);
>> else
>> ret = alloc_fresh_huge_page(h, nodes_allowed);
>> spin_lock(&hugetlb_lock);
> and you choose to patch both of the alloc_*() functions. Why not just
> fix it at the common call site? Seems like that
> spin_lock(&hugetlb_lock) could be a cond_resched_lock() which would fix
> both cases.
I agree to move the cond_resched() to a common site in set_max_huge_pages().
But do you mean the spin_lock in this while loop can be replaced by
cond_resched_lock?
IIUC, cond_resched_lock = spin_unlock+cond_resched+spin_lock.
So could you please explain more details about it? Thanks.
B.R.
Justin
> Also, putting that cond_resched() inside the for_each_node*() loop is an
> odd choice. It seems to indicate that the loops can take a long time,
> which really isn't the case. The _loop_ isn't long, right?
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH] mm/hugetlb: Avoid soft lockup in set_max_huge_pages() Jia He <hejianet@gmail.com> - 2016-07-26 17:50 +0200
Re: [RFC PATCH] mm/hugetlb: Avoid soft lockup in set_max_huge_pages() Dave Hansen <dave.hansen@linux.intel.com> - 2016-07-26 18:00 +0200
Re: [RFC PATCH] mm/hugetlb: Avoid soft lockup in set_max_huge_pages() hejianet <hejianet@gmail.com> - 2016-07-26 18:40 +0200
Re: [RFC PATCH] mm/hugetlb: Avoid soft lockup in set_max_huge_pages() hejianet <hejianet@gmail.com> - 2016-07-27 03:50 +0200
Re: [RFC PATCH] mm/hugetlb: Avoid soft lockup in set_max_huge_pages() Dave Hansen <dave.hansen@linux.intel.com> - 2016-07-27 17:30 +0200
csiph-web