From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85DCACA9ED1 for ; Fri, 1 Nov 2019 17:12:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 22F7620578 for ; Fri, 1 Nov 2019 17:12:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="buxhYq1v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22F7620578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6B7FF6B0005; Fri, 1 Nov 2019 13:12:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 669AF6B0006; Fri, 1 Nov 2019 13:12:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 556B36B0007; Fri, 1 Nov 2019 13:12:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id 2EC6B6B0005 for ; Fri, 1 Nov 2019 13:12:09 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 97A40181AEF1A for ; Fri, 1 Nov 2019 17:12:08 +0000 (UTC) X-FDA: 76108351536.09.brush67_2fc421cac5957 X-HE-Tag: brush67_2fc421cac5957 X-Filterd-Recvd-Size: 4475 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 1 Nov 2019 17:12:08 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id r22so3724153qtt.2 for ; Fri, 01 Nov 2019 10:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qBMruKDrI3Y48/s7yeyyJd+W3JxGzLZElVujOhMNo6A=; b=buxhYq1vZ0N+QH31OeIiVHzsQreNFrkDUAPUKeSLEcMP9R5h/LvZ1GURfJMH6xcb6Z V5dGQaCQILTWG6m52g+zvaEydQ2z0/OK0hdjk0KBPGP0c67PH+VKIGPmX3fL/+MtWb0v lahLDwyXElV9I+fckICB1sfR8tGhxiqfPRuz91j1pjQkiWmMfR9Ez30H+C38wajeAYo9 D9BLnuH/AGvfpzKkvvxs/jTUlQCkawfQuCciXnX3esNMzwPZw3e4ge6xsD1SKR41h8Fl KI9Xng7klJdU8WLnbmfY3Ra8exeWOMjLW3ZlMymad0COZ7Prkmre6Zcrj7xZtmQPaCyv RgXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=qBMruKDrI3Y48/s7yeyyJd+W3JxGzLZElVujOhMNo6A=; b=IcHLKaOHo5lRXKN9jB+lM1UL+Es7Eg+S6ql3FWTptvRJVRrbz0A0VV1fayhggbnwhd TP44qrx1a7onr5HBwvB36dFFDdIYAfimSH6D0XT2+RI82OdaplcRq9c9FVJermSyaf+W 6aG+y8t492QmSzb6POqIp1YyBMWYCAKR/NpuJdqUlV6pcWuF8a9AajRW3HV4b6QTxdg+ s5shEBI49l52/6dA8kIO1w/9V4AKbWmt/j+T1pwWCrKYIsDA+dpNEtNbhKT//9jlwxCJ ap0+bbuAAsLpDgrDO+I6W6olL8y4WFppno4N6h+RsML+xLf8tC1LkjJuzGJwIdCgUrTa LPaA== X-Gm-Message-State: APjAAAUkkwGSJFNQxnQtTP1FtN03fb59TyfyYqOfQO6aYMym5dDW3G/d HtsLlNjbz2W1bflQSCJEb9Q= X-Google-Smtp-Source: APXvYqyS8BC/NScTWDb66O2vz8siZmUL33ffFo8nCRgGbLvydjciCv+urAANR6Qa803PY7ZD0TFJ/g== X-Received: by 2002:ac8:51d4:: with SMTP id d20mr334345qtn.239.1572628327191; Fri, 01 Nov 2019 10:12:07 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::ad6a]) by smtp.gmail.com with ESMTPSA id o201sm3585630qka.17.2019.11.01.10.12.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Nov 2019 10:12:06 -0700 (PDT) Date: Fri, 1 Nov 2019 10:12:02 -0700 From: Tejun Heo To: Andrew Morton Cc: Shakeel Butt , Michal Hocko , "David S. Miller" , netdev@vger.kernel.org, Kernel Team , LKML , Josef Bacik , Eric Dumazet , Jakub Kicinski , Johannes Weiner , Linux MM , Mel Gorman Subject: Re: [PATCH v2] net: fix sk_page_frag() recursion from memory reclaim Message-ID: <20191101171202.GP3622521@devbig004.ftw2.facebook.com> References: <20191019170141.GQ18794@devbig004.ftw2.facebook.com> <20191024205027.GF3622521@devbig004.ftw2.facebook.com> <20191031162049.27e54d9412214aea79acd2ea@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191031162049.27e54d9412214aea79acd2ea@linux-foundation.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello, On Thu, Oct 31, 2019 at 04:20:49PM -0700, Andrew Morton wrote: > > > 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. > > > 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