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=-5.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,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 74F87C56202 for ; Mon, 9 Nov 2020 14:37:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EC188206D8 for ; Mon, 9 Nov 2020 14:37:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WE7W9+WZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC188206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D86E6B0036; Mon, 9 Nov 2020 09:37:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B00A6B005C; Mon, 9 Nov 2020 09:37:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 178896B005D; Mon, 9 Nov 2020 09:37:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id DFE726B0036 for ; Mon, 9 Nov 2020 09:37:10 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8EE80181AEF09 for ; Mon, 9 Nov 2020 14:37:10 +0000 (UTC) X-FDA: 77465132220.08.hand73_5d03ec9272ed Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 64D511819E766 for ; Mon, 9 Nov 2020 14:37:10 +0000 (UTC) X-HE-Tag: hand73_5d03ec9272ed X-Filterd-Recvd-Size: 5841 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Nov 2020 14:37:09 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id a65so8144470wme.1 for ; Mon, 09 Nov 2020 06:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=caIEYH7Eu5Xcnq+e7ySVcHnIwnQp8PB5zRJO0aE9sVM=; b=WE7W9+WZW2zEJ9SGPk0THFJtjIKY2AryBOzwd6VjZJsRHynfxhNuDZ93/pPzphwzTY yYX/NrenpziwuirAOgC7IlVVc0rni5qAWj8hkI11mfQExcsoUBk5k2IIyC+yFR1zfs+0 t5stdQx44NZjKjmlE+lta+If+cNt42Av4NbWB6FrDCL/PM7DPeJXM7CG8ATmfByGculE GOkmcLabPXyuF2KyeUb7nWQQc6gGHXcxoOp/tnjIvxDmgFUrZPBBEHkAtd7fgPyBkeaE Cx3ERzKzN9kGQxTepVlz9DlL9Xb35o0gNdVmVFOuZR219aQ6sECO4UfPZyojOc8O4L3O 76NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=caIEYH7Eu5Xcnq+e7ySVcHnIwnQp8PB5zRJO0aE9sVM=; b=eCq2nktoWtJGBXpHK6ugUK5SRyd+6d8QOVVw8XL6ypJb9IzYvtXnBU4X+aXtRPC4kV SupnXNMILX0LF++uksuJLfQJYUfyVq0vO86E7HBcglOvlJkFkd7gULCj5dZGcL//vknV OvG1gJszTvyqtoP/LyiSNfpPzhujWDbYUUPmxnBJlhEKbNRepFcY/lpEXet68v7WEwSO i6fL39z6Z88sGybd0kBUsHhyzHVLEbA/sZye9k6FIxrY7kZL5d48II6FhJPn+/7sKkDq PTwNvRSbSr4CskQ65HdfTw8Q2k56ZH28n17KmE7of943x4LqhLz+c0GB/dz1OF6ON2qI y0+w== X-Gm-Message-State: AOAM531GliHUgLzOvjSPUdWQrZ+X6szrtE8hnodRwKGWts/dpHpKZG+m DCCktuUSTG9fJQnFi0GCT8s= X-Google-Smtp-Source: ABdhPJy/OBxtlwQcJigGkaOwAxFgOjBrd5Z4mXA8WovN3u1qXxRRSdaeFRXEbNx1H6w9Q2tCmjheGA== X-Received: by 2002:a05:600c:210a:: with SMTP id u10mr14896062wml.98.1604932628611; Mon, 09 Nov 2020 06:37:08 -0800 (PST) Received: from [192.168.8.114] ([37.170.121.171]) by smtp.gmail.com with ESMTPSA id x18sm14661454wrg.4.2020.11.09.06.37.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Nov 2020 06:37:07 -0800 (PST) Subject: Re: [PATCH] page_frag: Recover from memory pressure To: Matthew Wilcox Cc: linux-mm@kvack.org, netdev@vger.kernel.org, Dongli Zhang , Aruna Ramakrishna , Bert Barbe , Rama Nichanamatlu , Venkat Venkatsubra , Manjunath Patil , Joe Jin , SRINIVAS , stable@vger.kernel.org References: <20201105042140.5253-1-willy@infradead.org> <20201105140224.GK17076@casper.infradead.org> <20201109143249.GB17076@casper.infradead.org> From: Eric Dumazet Message-ID: Date: Mon, 9 Nov 2020 15:37:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201109143249.GB17076@casper.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: On 11/9/20 3:32 PM, Matthew Wilcox wrote: > On Thu, Nov 05, 2020 at 02:02:24PM +0000, Matthew Wilcox wrote: >> On Thu, Nov 05, 2020 at 02:21:25PM +0100, Eric Dumazet wrote: >>> On 11/5/20 5:21 AM, Matthew Wilcox (Oracle) wrote: >>>> When the machine is under extreme memory pressure, the page_frag allocator >>>> signals this to the networking stack by marking allocations with the >>>> 'pfmemalloc' flag, which causes non-essential packets to be dropped. >>>> Unfortunately, even after the machine recovers from the low memory >>>> condition, the page continues to be used by the page_frag allocator, >>>> so all allocations from this page will continue to be dropped. >>>> >>>> Fix this by freeing and re-allocating the page instead of recycling it. >>>> >>>> Reported-by: Dongli Zhang >>>> Cc: Aruna Ramakrishna >>>> Cc: Bert Barbe >>>> Cc: Rama Nichanamatlu >>>> Cc: Venkat Venkatsubra >>>> Cc: Manjunath Patil >>>> Cc: Joe Jin >>>> Cc: SRINIVAS >>>> Cc: stable@vger.kernel.org >>>> Fixes: 79930f5892e ("net: do not deplete pfmemalloc reserve") >>> >>> Your patch looks fine, although this Fixes: tag seems incorrect. >>> >>> 79930f5892e ("net: do not deplete pfmemalloc reserve") was propagating >>> the page pfmemalloc status into the skb, and seems correct to me. >>> >>> The bug was the page_frag_alloc() was keeping a problematic page for >>> an arbitrary period of time ? >> >> Isn't this the commit which unmasks the problem, though? I don't think >> it's the buggy commit, but if your tree doesn't have 79930f5892e, then >> you don't need this patch. >> >> Or are you saying the problem dates back all the way to >> c93bdd0e03e8 ("netvm: allow skb allocation to use PFMEMALLOC reserves") >> >>>> + if (nc->pfmemalloc) { >>> >>> if (unlikely(nc->pfmemalloc)) { >> >> ACK. Will make the change once we've settled on an appropriate Fixes tag. > > Which commit should I claim this fixes? Hmm, no big deal, lets not waste time on tracking precise bug origin.