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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 4E707C5517A for ; Mon, 9 Nov 2020 14:32:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C0AA8206D8 for ; Mon, 9 Nov 2020 14:32:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Nu4sjnGp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0AA8206D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0BBB16B0036; Mon, 9 Nov 2020 09:32:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06C236B005C; Mon, 9 Nov 2020 09:32:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9D206B005D; Mon, 9 Nov 2020 09:32:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id BD9796B0036 for ; Mon, 9 Nov 2020 09:32:54 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 68E2C181AEF09 for ; Mon, 9 Nov 2020 14:32:54 +0000 (UTC) X-FDA: 77465121468.14.wool63_3f03a80272ed Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 4355E18229818 for ; Mon, 9 Nov 2020 14:32:54 +0000 (UTC) X-HE-Tag: wool63_3f03a80272ed X-Filterd-Recvd-Size: 4161 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Nov 2020 14:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0difR5ntKAj8MZoF1u1JlIpHzFXzeXVoqzhSBb4MMM8=; b=Nu4sjnGp0d9e/mL6SCEb7z/rzl w5I5wiXBe9gQMf2iSt4w1ng+1MDTwjJVNZIlbmJx2aguFBmKakFsz40OHMeFaaiIDJ8CudtLokbFM OMGcKilTyI5v1HIJvE/V9wAAYoWhbbegp9KjnGVFauhToOQs+bv+6Z5/L46sZcs6YZy7e4mU9ZXTe DkBe64uAGsC4hJ2JSUQEorZ5y5iDV4pNNCrizvFtch9MwOoFrbcX9+O7W3q55/j5LmhQpYOxqdQ0G Jl10K7SjwssDUtlmaQswE+ewnAYx9mC0jLHkfQnheQ+boLSgxxBWnKpdYaibMCq5sRjgefeI0lGOY 8mQXIMWQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kc8Dx-0001qu-Mx; Mon, 09 Nov 2020 14:32:49 +0000 Date: Mon, 9 Nov 2020 14:32:49 +0000 From: Matthew Wilcox To: Eric Dumazet 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 Subject: Re: [PATCH] page_frag: Recover from memory pressure Message-ID: <20201109143249.GB17076@casper.infradead.org> References: <20201105042140.5253-1-willy@infradead.org> <20201105140224.GK17076@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201105140224.GK17076@casper.infradead.org> 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 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?