Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2167484ybt; Fri, 3 Jul 2020 02:32:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3LV2LOeFnONFMMgZtTxpqssPSAOPzBT+PCi6JaICtU6cKcA8gxpidgS9paEuqgv0oY89k X-Received: by 2002:a50:fc88:: with SMTP id f8mr8222754edq.314.1593768776005; Fri, 03 Jul 2020 02:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593768776; cv=none; d=google.com; s=arc-20160816; b=E49Yp0K4j1znVFts8bEidMv8wRm50F9OBKzxmpS3oPaVX6aiASiJWxearkd3d9YZPh YIk91NWSI4CBl256a0v9giFAKaOqdC0hzj+RRARUAfDaDaH+AvSdHD8uSF+2ZaO9PdLm YN4drVdAmJBWzjoWeIfxTqiFkTs5IpXa4mYQID+6dhyseXwKoB22QEp2ZjHBWeYcNNfn 0/CCWmkNigtplZMWl7PQg181Jc1NEBof1TeJSqA3fJ3IMWCnO58MTjT1XJB+bKVvkwko flC97sQwstj3n3kXvRhzrnCFxcfKF87ORrpJOrtajzXwP0v33J1E6WzAnzfZzkaAre9o eXpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=pk6Tm4QjQfowhmdZnV11EaFkW5/qOsOPmFuc/Jl9f5Q=; b=Za6z+ybWmAKTozOihO+SAPybHthc5OgG/tDRHy3Y8r62+PThG5D0DJ3Dx4UwXZ+NVs jR38wOlpKoJL7ONfzHZRler1PgYGpTJDEmlN7uIdefUChTSnAdFRqOG6qPg/Sh9d2OGA BCc5JBkY3tXFFxPfVfbYlOePZ6nOIdFfy2baMO43pJtPdMTgzMfthrmU3E9YGXp3bOh9 kR/4Mx2hHlRE+YNz6Litp++6Vw4mFbRz8llHb2WxlGnPaM9Q81IilpZ9QC6BA+dMYV7F AJk4mvP7lxF7a0hlDmrj7QhOSJfXMhuasO0+iS7lktHu5w1slc2r9sv0+qnuKG5oEXUJ 2g0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lk3si7261420ejb.653.2020.07.03.02.32.32; Fri, 03 Jul 2020 02:32:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726291AbgGCJaM (ORCPT + 99 others); Fri, 3 Jul 2020 05:30:12 -0400 Received: from mga05.intel.com ([192.55.52.43]:61960 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbgGCJaL (ORCPT ); Fri, 3 Jul 2020 05:30:11 -0400 IronPort-SDR: dgShyHnAEW8DJdWyrcGPldNDGlytC122C5vXdQK4npdqcJyOrZ7IgS+xQV9GVAm7ftU5ihWsU1 C2hkQABmOBnw== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="231986881" X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="231986881" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 02:30:11 -0700 IronPort-SDR: l31gYcmKNMh0jJgY194TtzUizoIW0DpsWBdZeEs9ROHqsohAxscc7OynGyejlLP/6GMDUzY+XA s5mLMPhfEedg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="278387141" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga003.jf.intel.com with ESMTP; 03 Jul 2020 02:30:09 -0700 From: "Huang\, Ying" To: Dave Hansen Cc: , , , , Subject: Re: [RFC][PATCH 8/8] mm/numa: new reclaim mode to enable reclaim-based migration References: <20200629234503.749E5340@viggo.jf.intel.com> <20200629234517.A7EC4BD3@viggo.jf.intel.com> Date: Fri, 03 Jul 2020 17:30:09 +0800 In-Reply-To: <20200629234517.A7EC4BD3@viggo.jf.intel.com> (Dave Hansen's message of "Mon, 29 Jun 2020 16:45:17 -0700") Message-ID: <87imf5djz2.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Hansen writes: > +/* > + * React to hotplug events that might online or offline > + * NUMA nodes. > + * > + * This leaves migrate-on-reclaim transiently disabled > + * between the MEM_GOING_OFFLINE and MEM_OFFLINE events. > + * This runs whether RECLAIM_MIGRATE is enabled or not. > + * That ensures that the user can turn RECLAIM_MIGRATE > + * without needing to recalcuate migration targets. > + */ > +#if defined(CONFIG_MEMORY_HOTPLUG) > +static int __meminit migrate_on_reclaim_callback(struct notifier_block *self, > + unsigned long action, void *arg) > +{ > + switch (action) { > + case MEM_GOING_OFFLINE: > + /* > + * Make sure there are not transient states where > + * an offline node is a migration target. This > + * will leave migration disabled until the offline > + * completes and the MEM_OFFLINE case below runs. > + */ > + disable_all_migrate_targets(); > + break; > + case MEM_OFFLINE: > + case MEM_ONLINE: > + /* > + * Recalculate the target nodes once the node > + * reaches its final state (online or offline). > + */ > + set_migration_target_nodes(); > + break; > + case MEM_CANCEL_OFFLINE: > + /* > + * MEM_GOING_OFFLINE disabled all the migration > + * targets. Reenable them. > + */ > + set_migration_target_nodes(); > + break; > + case MEM_GOING_ONLINE: > + case MEM_CANCEL_ONLINE: > + break; I think we need to call disable_all_migrate_targets()/set_migration_target_nodes() for CPU online/offline event too. Because that will influence node_state(nid, N_CPU). Which will influence node demotion relationship. > + } > + > + return notifier_from_errno(0); > } > + Best Regards, Huang, Ying