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 2C259C433FE for ; Wed, 2 Nov 2022 17:47:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7458E8E0002; Wed, 2 Nov 2022 13:47:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F53F8E0001; Wed, 2 Nov 2022 13:47:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BDCF8E0002; Wed, 2 Nov 2022 13:47:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4BEAC8E0001 for ; Wed, 2 Nov 2022 13:47:25 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1840412093C for ; Wed, 2 Nov 2022 17:47:25 +0000 (UTC) X-FDA: 80089234050.21.F099AB8 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf25.hostedemail.com (Postfix) with ESMTP id 756A4A0002 for ; Wed, 2 Nov 2022 17:47:23 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4B48E1F855; Wed, 2 Nov 2022 17:47:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1667411242; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bIXibXXjjmnVVHx6xjVFUipVPFmWAiVSbZzEqPxgGqU=; b=gIsTGpGgO0MrSHOFFGoAwL+viqPrxOnfGXqwBcdrDNOz2aiMyvX2X8419Cvfk6GWPGoJB5 4mQ8qcsOKYh6eF3aAb36+YLp1iq5ueprzeCyLwRpHHa8LEezhpAVTTS1aLnc+19TdlZ+lT CfQWH4wz9OsbO9obcDsQtc+EpgcMwQ8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3089A139D3; Wed, 2 Nov 2022 17:47:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id e3wLCiqtYmMKSQAAMHmgww (envelope-from ); Wed, 02 Nov 2022 17:47:22 +0000 Date: Wed, 2 Nov 2022 18:47:21 +0100 From: Michal Hocko To: Yang Shi Cc: Zach O'Keefe , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: don't warn if the node is offlined Message-ID: References: <20221031183122.470962-1-shy828301@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667411244; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bIXibXXjjmnVVHx6xjVFUipVPFmWAiVSbZzEqPxgGqU=; b=keops8Lwhud3Ohrtic4Dq8h/APZwrrY3YGxYyvLNNuATx6BToh2tO/ji8tztszliBssPkf S6FZAG7v3XSWmW9cHwCaf9POwjlbAyM9NtuWQgz++zhUDYKwS7FBJwCVxecosi/hg+yy0J Qas7rrI40+j8+cenwZyeyQuDzTgCvkU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=gIsTGpGg; spf=pass (imf25.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667411244; a=rsa-sha256; cv=none; b=Q7yN8xdeC4R930G3ua3yv1X7UPp+cWWgeWdOsyhK0k7rOLb3kvgLBDjTrVJY9plZR+uGf8 lO1QZcyNlGxTMiY9z8NhyADufe9AucUu8dAdU1xNwTv14PijMFyxGnHWbnST+y/HV6vxds nifrxC9Ra/NHshxEPP7AlJPrnL2jq90= X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 756A4A0002 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=gIsTGpGg; spf=pass (imf25.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Stat-Signature: 936qrfodtz6my1zjqpx9wc9d3fyq99w4 X-HE-Tag: 1667411243-651571 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 Wed 02-11-22 10:36:07, Yang Shi wrote: > On Wed, Nov 2, 2022 at 9:15 AM Michal Hocko wrote: > > > > On Wed 02-11-22 09:03:57, Yang Shi wrote: > > > On Wed, Nov 2, 2022 at 12:39 AM Michal Hocko wrote: > > > > > > > > On Tue 01-11-22 12:13:35, Zach O'Keefe wrote: > > > > [...] > > > > > This is slightly tangential - but I don't want to send a new mail > > > > > about it -- but I wonder if we should be doing __GFP_THISNODE + > > > > > explicit node vs having hpage_collapse_find_target_node() set a > > > > > nodemask. We could then provide fallback nodes for ties, or if some > > > > > node contained > some threshold number of pages. > > > > > > > > I would simply go with something like this (not even compile tested): > > > > > > Thanks, Michal. It is definitely an option. As I talked with Zach, I'm > > > not sure whether it is worth making the code more complicated for such > > > micro optimization or not. Removing __GFP_THISNODE or even removing > > > the node balance code should be fine too IMHO. TBH I doubt there would > > > be any noticeable difference. > > > > I do agree that an explicit nodes (quasi)round robin sounds over > > engineered. It makes some sense to try to target the prevalent node > > though because this code can be executed from khugepaged and therefore > > allocating with a completely different affinity than the original fault. > > Yeah, the corner case comes from the node balance code, it just tries > to balance between multiple prevalent nodes, so you agree to remove it > IIRC? Yeah, let's just collect all good nodes into a nodemask and keep __GFP_THISNODE in place. You can consider having the nodemask per collapse_control so that you allocate it only once in the struct lifetime. And as mentioned in other reply it would be really nice to hide this under CONFIG_NUMA (in a standalong follow up of course). -- Michal Hocko SUSE Labs