Thread (17 messages) 17 messages, 6 authors, 2019-11-01

Re: [PATCH v2] net: fix sk_page_frag() recursion from memory reclaim

From: Tejun Heo <tj@kernel.org>
Date: 2019-11-01 17:12:10
Also in: linux-mm, lkml

Hello,

On Thu, Oct 31, 2019 at 04:20:49PM -0700, Andrew Morton wrote:
quoted
quoted
In [0], tcp_send_msg_locked() was using current->page_frag when it
"tcp_sendmsg_locked" and "current->task_frag".  Stuff like this makes
review harder :(
lol, sorry about that.
quoted
quoted
Fix it by adding gfpflags_normal_context() which tests sleepable &&
!reclaim and use it to determine whether to use current->task_frag.
Dumb-but-obvious question.  Rather than putzing with allocation modes,
is it not feasible to change the net layer to copy the current value of
current->task_frag into a local then restore its value when it has
finished being used?
It's being used as an allocation cache, so doing so would lead to the
same area getting allocated for two packets at the same time instead
overrunning the end of the cache.

Thanks.

-- 
tejun
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help