Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp997195rdb; Mon, 19 Feb 2024 00:10:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXgrpVTvFRidPbUzz5MD1cpEj24rzvd6Y+1dTomC0iaByVwQTWoDj1dSSlurDzk7kaHtC9ltOa6EPCyBzUq9xB08LnPmhG+Ugdsm1PEpA== X-Google-Smtp-Source: AGHT+IHTdBN3oJ7YYt/uAzWcNXDIu+/aZ5P7AoAIc7HtmZ9JPzJjA+aclXGH/nWlR1wAodUZdIdg X-Received: by 2002:a05:6a20:7189:b0:19c:1881:b4fa with SMTP id s9-20020a056a20718900b0019c1881b4famr10605654pzb.33.1708330248620; Mon, 19 Feb 2024 00:10:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708330248; cv=pass; d=google.com; s=arc-20160816; b=qGYEdXjF25frK6HF17MiMF9GeCjPPDUUtTYZcNgdH3A3730+d8qoxLeklolqb9BUXm r9dvbp5ukyxX3PdQo44LkHH77W1rNzyAB8kRz3OCI1bFBxveda/cFBTVrDIEEsyipHSm OAWXBlq+pb6Wokdv7LblWjMeAEv9ArCFLaY8Et67dkMNeRPOK9QfP24WPtOA3QbiJlJl c2ElTlov+wwxuTCaHCgMCHxP3rB9dQVMA2wBA946EJlVvM71xQt2tzYKaFcBeivfXWZq f/LcDNB6J+xdKHWS1CXOG8BbHbH/G/GLuuQxvfI0c1HQ7Is6Mnp+SuZE+2T/hpZ+BcAZ YxRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=+W/bpv2D3c0ZM1YOskN3/VvP+1dFlkBTARg3DDHNZV4=; fh=JniDVSk1Y8Eo2N+CyzF/QcmRMd8ioox/RHZHLImWmUc=; b=0j9I4SkN+zFHwYS8Tcf8uKu+jiTQ4Phvf1bXF3CiOJSPMbeYyw8Dj9c1kz5iW4L5UR 9MYnKOinhwPpb8rfSfoCRqD2oQyeRSYro56vG4AGm9xmcO8o1GWhrC1bg/nId4qNSzMW /w4GZvbCSGJiWtaxwz1oyVyWw2WomcQ4z/K6hLuWA8Chk+2TS8ZF14A2WURyxnp9/Fqe vH5dKpZGg1AEiRd96ChTpfL9FKTQ5GewGd6hZ2XL86x312YvbYz+ii3IN0PYvw037pSX OhUjHOEawe0/q+HUCIC+MxkHguKthYB0kB5240Vp/BeDjVbYXi4o2GH+159vsn+b0RBu J4/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Sb4MAF9D; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Sb4MAF9D; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-70907-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70907-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cz16-20020a17090ad45000b002991443e4cesi4161010pjb.24.2024.02.19.00.10.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 00:10:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70907-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Sb4MAF9D; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Sb4MAF9D; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-70907-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70907-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4F7062820FA for ; Mon, 19 Feb 2024 08:10:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F8A020DFD; Mon, 19 Feb 2024 08:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Sb4MAF9D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="IlB1cgVw"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Sb4MAF9D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="IlB1cgVw" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59E3A20DD9; Mon, 19 Feb 2024 08:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708330199; cv=none; b=Daqabe78D2S/aSn8cz4vx4gHUaX2x2FzZ4Z0rzenHUhrkeiix7o2cxX2g4V1qvoq0wadbMBY/sJ03VZu9kpgI6cZQ4m1+KqIx1kphsCpPChMJJH0RDoCQ0ruscAoovm/5cLloNlKf26l8GIjunlY/tk7+Xf7AB+9y2IxxST/wmo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708330199; c=relaxed/simple; bh=kYA5wdHtwjrn8oLeN1C1LqpgvH68DRjLShJ/XuooKMg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L9sosR7d/45krp3pJfjRuMIxfFdoohSrI/4X+g46M/9pag0Rqb9fLp/I/ZJ3aTVpaoYv/nDuaUMhPFZADfj4NSf430q6LnCulm2w7JGKOpzpzILxweMW9VGEFz1bjR8y+UfAB+Yu9JnSuqpfe5IXIxT+/xFtzwqKmgP37BzluJk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Sb4MAF9D; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=IlB1cgVw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Sb4MAF9D; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=IlB1cgVw; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 860141F7DD; Mon, 19 Feb 2024 08:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708330195; 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=+W/bpv2D3c0ZM1YOskN3/VvP+1dFlkBTARg3DDHNZV4=; b=Sb4MAF9DroERnRVpTUQKSc6xiAwy9itXQnqmCAmWldYwnhwba3C+m7puLCqejqZeK9V/GQ +d+RqD0PG7AabQv9q52OZ4AYm2i+YsJEwgNMQM5Re5L4LYDp9o106dGDcvOv/kgnvy7o5Q 8QEe9R8B9CpTaNiiHG0WuRdO+I7wON4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708330195; 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=+W/bpv2D3c0ZM1YOskN3/VvP+1dFlkBTARg3DDHNZV4=; b=IlB1cgVwV2qR4MEjkpQRMz+jGRbWHpkHwHhdjiKwhJG6aoLRcvrsbGqsdn0VRZ56EIGyeP SK5KuG8f2+U1dKDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708330195; 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=+W/bpv2D3c0ZM1YOskN3/VvP+1dFlkBTARg3DDHNZV4=; b=Sb4MAF9DroERnRVpTUQKSc6xiAwy9itXQnqmCAmWldYwnhwba3C+m7puLCqejqZeK9V/GQ +d+RqD0PG7AabQv9q52OZ4AYm2i+YsJEwgNMQM5Re5L4LYDp9o106dGDcvOv/kgnvy7o5Q 8QEe9R8B9CpTaNiiHG0WuRdO+I7wON4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708330195; 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=+W/bpv2D3c0ZM1YOskN3/VvP+1dFlkBTARg3DDHNZV4=; b=IlB1cgVwV2qR4MEjkpQRMz+jGRbWHpkHwHhdjiKwhJG6aoLRcvrsbGqsdn0VRZ56EIGyeP SK5KuG8f2+U1dKDg== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id F22F213585; Mon, 19 Feb 2024 08:09:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 3gZiONIM02U6PAAAn2gu4w (envelope-from ); Mon, 19 Feb 2024 08:09:54 +0000 Date: Mon, 19 Feb 2024 09:11:06 +0100 From: Oscar Salvador To: Baolin Wang Cc: Byungchul Park , akpm@linux-foundation.org, ying.huang@intel.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, stable@vger.kernel.org Subject: Re: [PATCH] mm/vmscan: Fix a bug calling wakeup_kswapd() with a wrong zone index Message-ID: References: <20240216111502.79759-1-byungchul@sk.com> <517e58d4-7537-4d9f-8893-0130c65c3fdb@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <517e58d4-7537-4d9f-8893-0130c65c3fdb@linux.alibaba.com> X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Sb4MAF9D; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=IlB1cgVw X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-2.41 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[9]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.90)[86.08%] X-Spam-Score: -2.41 X-Rspamd-Queue-Id: 860141F7DD X-Spam-Flag: NO On Mon, Feb 19, 2024 at 02:25:11PM +0800, Baolin Wang wrote: > This means that there is no memory on the target node? if so, we can add a > check at the beginning to avoid calling unnecessary > migrate_misplaced_folio(). > > diff --git a/mm/memory.c b/mm/memory.c > index e95503d7544e..a64a1aac463f 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -5182,7 +5182,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf) > else > last_cpupid = folio_last_cpupid(folio); > target_nid = numa_migrate_prep(folio, vma, vmf->address, nid, > &flags); > - if (target_nid == NUMA_NO_NODE) { > + if (target_nid == NUMA_NO_NODE || !node_state(target_nid, N_MEMORY)) > { > folio_put(folio); > goto out_map; > } > > (similar changes for do_huge_pmd_numa_page()) With the check in place from [1], numa_migrate_prep() will also return NUMA_NO_NODE, so no need for this one here. And I did not check, but I assume that do_huge_pmd_numa_page() also ends up calling numa_migrate_prep(). [1] https://lore.kernel.org/lkml/20240219041920.1183-1-byungchul@sk.com/ -- Oscar Salvador SUSE Labs