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 8E4FAC021AA for ; Fri, 21 Feb 2025 09:48:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0991F280016; Fri, 21 Feb 2025 04:48:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 04898280015; Fri, 21 Feb 2025 04:48:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2AB9280016; Fri, 21 Feb 2025 04:48:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C645E280015 for ; Fri, 21 Feb 2025 04:48:33 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 45CCF160C9B for ; Fri, 21 Feb 2025 09:48:33 +0000 (UTC) X-FDA: 83143476906.26.7E699B5 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf10.hostedemail.com (Postfix) with ESMTP id B7FFFC0002 for ; Fri, 21 Feb 2025 09:48:30 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=J8g6ynmI; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=SiIisenH; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Rndu6kxt; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=wwHv7E2s; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740131311; a=rsa-sha256; cv=none; b=eoqWqNGRuY5vjKiIne2qDMDGfYGOdWygWnqxTDOlQDiAovw8/5jGKc1VV/HbjPjU8+J5Dp 8tlXFfNYn6ROP+x5jiv907RxdtxWPVoE1cWmRt5eEsk4NvEls2kqVfbXImTmHTZeWYizcU ANvcH0bvDH9wI7kKadis+Zbd9LXyC0g= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=J8g6ynmI; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=SiIisenH; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Rndu6kxt; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=wwHv7E2s; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 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=1740131311; 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=MqyX7HGqPKp4niDYTusUzp5w/Yf2gRba6+xe39ad1cc=; b=OyEJ6uoOW0Hz8mGaeMZhh3vrNc145+YEjaumCB227RDpP6VOqFa3eiKojVxkiApkWYVXLf TgPkjPB9vnh3L+JcPIqMKaOuePV4f3IWrBY+efOk9LnbLMpdqTSfrsVFmuxbkH/5IqUdP3 MVbNHMx7nCGDs599jPWwiP6o/PSE9SM= 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-out1.suse.de (Postfix) with ESMTPS id F010F211D2; Fri, 21 Feb 2025 09:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740131309; 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=MqyX7HGqPKp4niDYTusUzp5w/Yf2gRba6+xe39ad1cc=; b=J8g6ynmIvSu4XXEpTtBbpskTxMPL4ZX1c/QyTPREln/InEUNChz+EgoaxXdJUh5o+YtZxH L2R0pH69rbi8LETBbP5atwHYY38YvwxhVB8E2+84sDYlYvVOCn9dsRWB1H/h/wO5YQP/TY pF5vzB+QJWd54vk/coDFIUdsPEwy4Gk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740131309; 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=MqyX7HGqPKp4niDYTusUzp5w/Yf2gRba6+xe39ad1cc=; b=SiIisenHj+jkGc9PSBgzR6yE7xEpbmn7yQHBOsHoGNzqn/P84SpXfIn+R/QqSzCTH7Chq6 ZBfha9WpVOk202AA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740131308; 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=MqyX7HGqPKp4niDYTusUzp5w/Yf2gRba6+xe39ad1cc=; b=Rndu6kxt4mMRvoIxJor9KNG2q7htS7KGO/4owQ86bVMsbg3eHK57Fs83MtNwJVvEYjHJRa 3RjHOBiukI2cTe7kOTMynvxTCBsl4gy5H0dqCdYg1K3OuAxclQPsjvnjpA4UUyc/lZ3hbF f71Tsf7TlC71zG1XfA/91/e5uVKkWjU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740131308; 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=MqyX7HGqPKp4niDYTusUzp5w/Yf2gRba6+xe39ad1cc=; b=wwHv7E2sD9jV31h0+MjtCCx/du9cFxjGcGyPW82y2xZp7o9VxiwSfyfaI0Bpnn0DTWZMi9 2ajRllDyEzAiDXBQ== 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 D8A43136AD; Fri, 21 Feb 2025 09:48:28 +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 nnPHMuxLuGcZLQAAD6G6ig (envelope-from ); Fri, 21 Feb 2025 09:48:28 +0000 Message-ID: Date: Fri, 21 Feb 2025 10:48:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm, percpu: do not consider sleepable allocations atomic Content-Language: en-US To: Dennis Zhou , Michal Hocko Cc: Tejun Heo , Filipe Manana , Andrew Morton , linux-mm@kvack.org, LKML References: <20250206122633.167896-1-mhocko@kernel.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Stat-Signature: uwhiuihwx3mcc8rx9qqx3dd71gdqk4c9 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: B7FFFC0002 X-Rspam-User: X-HE-Tag: 1740131310-503656 X-HE-Meta: U2FsdGVkX18Ym6g2FOlxVO3ZINALCwUyt46/RJ335TGOnY/Q+eVRurlYXhRw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bIHUSMMYWpeMVsFmf9ef6L0lFKVtaMtupJzbOiqUM6rI6Yp4ekfhJuxmyj5r4xEVLQQwlx6P4y84hoLYMIcoxaBSSo0TmnUqz2/WJp47pHu4cl3iJnxb5hdvQiKT0/NW691qu94+7PlzFBIUUx X-Bogosity: Ham, tests=bogofilter, spamicity=0.001375, 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 2/21/25 03:36, Dennis Zhou wrote: > I've thought about this in the back of my head for the past few weeks. I > think I have 2 questions about this change. > > 1. Back to what TJ said earlier about probing. I feel like GFP_KERNEL > allocations should be okay because that more or less is control plane > time? I'm not sure dropping PR_SET_IO_FLUSHER is all that big of a > work around? This solves the iscsid case but not other cases, where GFP_KERNEL allocations are fundamentally impossible. > 2. This change breaks the feedback loop as we discussed above. > Historically we've targeted 2-4 free pages worth of percpu memory. > This is done by kicking the percpu work off. That does GFP_KERNEL > allocations and if that requires reclaim then it goes and does it. > However, now we're saying kswapd is going to work in parallel while > we try to get pages in the worker thread. > > Given you're more versed in the reclaim side. I presume it must be > pretty bad if we're failing to get order-0 pages even if we have > NOFS/NOIO set? IMHO yes, so I don't think we need to pre-emptively fear that situation that much. OTOH in the current state, depleting pcpu's atomic reserves and failing pcpu_alloc due to not being allowed to take the mutex can happen easily and even if there's plenty of free memory. > My feeling is that we should add back some knowledge of the > dependency so if the worker fails to get pages, it doesn't reschedule > immediately. Maybe it's as simple as adding a sleep in the worker or > playing with delayed work... I think if we wanted things to be more robust (and perhaps there's no need to, see above), the best way would be to make the worker preallocate with GFP_KERNEL outside of pcpu_alloc_mutex. I assume it's probably not easy to implement as page table allocations are involved in the process and we don't have a way to supply preallocated memory for those. > Thanks, > Dennis