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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96E6AC282DE for ; Mon, 10 Mar 2025 11:03:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A59B2280002; Mon, 10 Mar 2025 07:03:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E169280001; Mon, 10 Mar 2025 07:03:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 835E3280002; Mon, 10 Mar 2025 07:03:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 67BB6280001 for ; Mon, 10 Mar 2025 07:03:38 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 39712B7CD0 for ; Mon, 10 Mar 2025 11:03:39 +0000 (UTC) X-FDA: 83205355758.15.5C708BA Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf29.hostedemail.com (Postfix) with ESMTP id D1D8D120015 for ; Mon, 10 Mar 2025 11:03:36 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=YK5RY8ye; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=+pFF7HOj; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=hS8yxrDz; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=7SeOIjCw; spf=pass (imf29.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741604617; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zWokT2IM8sYu7FZhG0F0lhGI2QCoe6MEh1ZciFacqfk=; b=czrpZn9d7/q3JbgjlgdXG9i8PMqP4wyQ3JlpJ3rWFshZlltk72B0hmD0HFoTVcKiQKItL8 DZzyq1cc+AJ25lUb6X424cn7o78j6aEtFI3h+NjW27nbE/pbgm6MS3s3F2eRF221SQJNl0 sxdEs8I9V4IVJXlEwQtJ6zR29G8JC+8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=YK5RY8ye; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=+pFF7HOj; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=hS8yxrDz; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=7SeOIjCw; spf=pass (imf29.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741604617; a=rsa-sha256; cv=none; b=Pd8Z73dywO0xgy6c/UvwJbTulH/ItZjtsGJ7G5Lu0fO1VRVhpRfbchv1jkMyh1ooiq6Ah+ n2Hx92gCIiVkIYabYoWNGDYMnruRFp3aikN1vYcIna2g5eNoUCg/gW+OlXFjRKGxlnVmeM 6JOw+OllMUby8mwEFSdzxoTUvWX35Ko= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EF1D21F441; Mon, 10 Mar 2025 11:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1741604615; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zWokT2IM8sYu7FZhG0F0lhGI2QCoe6MEh1ZciFacqfk=; b=YK5RY8yeI0XFeY+JEp8bdCLCzPDSmOK8H+woesKqLcNlJYnn8vLTpHeE359baqlnXo3AUX xUOhs0sx1j0aF0t6WWuw61Cg+Rvh7h0LptzGFzs5iQtJvwidbxbBTTCfAhOokWpq9CzPzG dhefgmLN6mtK1B2jPTGGXsavfy3Lz0Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1741604615; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zWokT2IM8sYu7FZhG0F0lhGI2QCoe6MEh1ZciFacqfk=; b=+pFF7HOjl8tMgaF65QVGAGnNkCPCASjsj3XfWzwTimAH/LmMRgPufx0IYr3oEour+qSzVs 8aYDMR9rbQ2mU1Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1741604614; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zWokT2IM8sYu7FZhG0F0lhGI2QCoe6MEh1ZciFacqfk=; b=hS8yxrDzaevWgM4q6jLS+Y7TyjdhV8sLQKKk7HwKNv/9F/jM20BFfyD0qiVWUSej9MMFl9 ShruwSH5ueOtsze0NuND/4bITypcodOYcLrc8viULv96mBNRmnahrZzzkbSmRD0AoHMk4J AFkXDZNxUlsaqGoBdFuLDW4IXiLXECA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1741604614; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zWokT2IM8sYu7FZhG0F0lhGI2QCoe6MEh1ZciFacqfk=; b=7SeOIjCwy/X/bgvcCBOH3pbrEHTQnrkBMGOpqKiw/Zgkx1tSj0ch/G46ck1IayTqFF0J2/ qziexklndTh8/QAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D7D11139E7; Mon, 10 Mar 2025 11:03:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id bXVHNAbHzmfbdAAAD6G6ig (envelope-from ); Mon, 10 Mar 2025 11:03:34 +0000 Message-ID: <9d8f5f92-5f4b-4732-af48-3ecaa41af81a@suse.cz> Date: Mon, 10 Mar 2025 12:03:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [linux-next:master] [memcg] 01d37228d3: netperf.Throughput_Mbps 37.9% regression Content-Language: en-US To: Alexei Starovoitov Cc: kernel test robot , Alexei Starovoitov , oe-lkp@lists.linux.dev, kbuild test robot , Michal Hocko , Shakeel Butt , "open list:CONTROL GROUP (CGROUP)" , linux-mm References: <202503101254.cfd454df-lkp@intel.com> <7c41d8d7-7d5a-4c3d-97b3-23642e376ff9@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Rspam-User: X-Rspamd-Queue-Id: D1D8D120015 X-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gb52eUM1sYnANXa7FORmOQEwESB4/glYzkYw8eWkjZOcpEe4RZfAMbQYv1yEK+XN67w3oDhktB5P+CGt8j0Y9i8pQznkGJNa0sJzq5Jgq8dnFrqMlSFPq8dHU6YGF83V+FSVXAqQFwQwYEc5lNBfmumORzzfW5NrI/hH3NaL3VBJy5Bi2HTRE39415bPo96AkXeAGeoVgvRz9cl08GEUn3dpFN9p7m136dzNHpYV5l+ci9G9fNyhEQDOxxL/eE28rem9PsV32GlFVXj2rZ5pZ+C0tRz02/qawDb4bEr5djvpd1jEqnXCI25ePjSqa+NQ2zI2wh8p2nVt5dXNjFzHOoxwRK9TdPqs8x1mUTwjYw4uU8ao0+oZ7IjZVptOZn5KAaGbfa+hFmElTPGzZyJS+4L4KR5QyGZI9GHg15z2Znwbubrs2Xmnq5LeVDt3r6O8npcVa5Ge+HSWe5+23 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: List-Subscribe: List-Unsubscribe: On 3/10/25 11:56, Alexei Starovoitov wrote: > On Mon, Mar 10, 2025 at 11:34 AM Vlastimil Babka wrote: >> >> On 3/10/25 11:18, Alexei Starovoitov wrote: >> >> because this will affect the refill even if consume_stock() fails not due to >> >> a trylock failure (which should not be happening), but also just because the >> >> stock was of a wrong memcg or depleted. So in the nowait context we deny the >> >> refill even if we have the memory. Attached patch could be used to see if it >> >> if fixes things. I'm not sure about the testcases where it doesn't look like >> >> nowait context would be used though, let's see. >> > >> > Not quite. >> > GFP_NOWAIT includes __GFP_KSWAPD_RECLAIM, >> > so gfpflags_allow_spinning() will return true. >> >> Uh right, it's the new gfpflags_allow_spinning(), not the >> gfpflags_allow_blocking() I'm used to and implicitly assumed, sorry. >> >> But then it's very simple because it has a bug: >> gfpflags_allow_spinning() does >> >> return !(gfp_flags & __GFP_RECLAIM); >> >> should be !! > > Ouch. > So I accidentally exposed the whole linux-next to this stress testing > of new trylock facilities :( > But the silver lining is that this is the only thing that blew up :) > Could you send a patch or I will do it later today. OK ----8<---- >From 69b3d1631645c82d9d88f17fb01184d24034df2b Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: Mon, 10 Mar 2025 11:57:52 +0100 Subject: [PATCH] mm: Fix the flipped condition in gfpflags_allow_spinning() The function gfpflags_allow_spinning() has a bug that makes it return the opposite result than intended. This could contribute to deadlocks as usage profilerates, for now it was noticed as a performance regression due to try_charge_memcg() not refilling memcg stock when it could. Fix the flipped condition. Fixes: 97769a53f117 ("mm, bpf: Introduce try_alloc_pages() for opportunistic page allocation") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202503101254.cfd454df-lkp@intel.com Signed-off-by: Vlastimil Babka --- include/linux/gfp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index ceb226c2e25c..c9fa6309c903 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -55,7 +55,7 @@ static inline bool gfpflags_allow_spinning(const gfp_t gfp_flags) * regular page allocator doesn't fully support this * allocation mode. */ - return !(gfp_flags & __GFP_RECLAIM); + return !!(gfp_flags & __GFP_RECLAIM); } #ifdef CONFIG_HIGHMEM -- 2.48.1