Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2770726pxb; Tue, 21 Sep 2021 07:19:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiax6CnAwZ0YvDt65VWBtGHVJkvI2m75fZ3V5mIY3WmgrilWt5tCwBkT0OMMOV769ajHWC X-Received: by 2002:a6b:f604:: with SMTP id n4mr161163ioh.99.1632233971527; Tue, 21 Sep 2021 07:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632233971; cv=none; d=google.com; s=arc-20160816; b=J4JIAIUI4Diunoi5GhzJt0wve8dOP9QB+1mV220NmZZBQLE6/E8+SdZSxduX2m8hCP b3W2/msZzF91pfCvQaxvNat2PGRgEyIAkJ3HXM+v+kQckjGSEheG7MRZQAfE2yR2ITQ/ 2g1wUvXrZ69GsrkR20Mv1X8DrVBWZGtltXncpip5w/UT3nnjuLjgNuZjlxQdwBQGtGhI f4zObJsVkZjYw0oUJy6r6t+24rZZrsu99ZGK/WsnK+8vm27PLUrfLkC43axxAsFUl+Ov RtsBTYWIcy07r/GkpDKlTevyNdRnl7iH1hzL97mwIFY4sBFigL/LxBH5K/nmFxUK1j8j iaHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from; bh=7gFLWHEeGiXCOyr7IosbwWnyqHHRU/mXfPQvKrFsxdM=; b=U+h+GBV9/S5XLFAw7XhzJ4Dl46qOFRbW78FfHhOW2kBt/wHOeaj445CXmMY4xZWx7I ddyFbHbmp+6Y/Hgf8vTRwaDJRYe2QG7DLK3ViwNeWmxBGKg0uzU4+oxSet4qwM2yA7Ld lP+uEgi/TRLVdPo/9MegEltVHMLuMgwwI3FBrA+Fehw/ADhS1a1MerSJA80ZiFFcL1QP oWUTtVd8Dxbykiqop3ybn4rRuOElcP8gEB4h5p+zwxO3YcRXF7jJTfC7kwaVgE8pcq2L Fus1Mq6yeEstFkd1nOrB34rnkbHACLZPWhl/vDs1dHrKuxeLzqc1B8JXLlsONQm34Dq8 2YRw== 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 p8si16931144ilo.5.2021.09.21.07.19.17; Tue, 21 Sep 2021 07:19:31 -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 S233532AbhIUOTl (ORCPT + 99 others); Tue, 21 Sep 2021 10:19:41 -0400 Received: from mga18.intel.com ([134.134.136.126]:27769 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233352AbhIUOTk (ORCPT ); Tue, 21 Sep 2021 10:19:40 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10113"; a="210450840" X-IronPort-AV: E=Sophos;i="5.85,311,1624345200"; d="scan'208";a="210450840" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2021 07:06:09 -0700 X-IronPort-AV: E=Sophos;i="5.85,311,1624345200"; d="scan'208";a="549502391" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.159.119]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2021 07:06:05 -0700 From: "Huang, Ying" To: Weizhao Ouyang Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual , Michal Hocko , John Hubbard , Pavel Tatashin , Yang Shi , Zi Yan , Dave Hansen , Minchan Kim , Mina Almasry , "Matthew Wilcox (Oracle)" , Oscar Salvador , Wei Xu Subject: Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names References: <20210921064553.293905-1-o451686892@gmail.com> <20210921064553.293905-3-o451686892@gmail.com> <87mto676fq.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Tue, 21 Sep 2021 22:06:03 +0800 In-Reply-To: (Weizhao Ouyang's message of "Tue, 21 Sep 2021 15:31:27 +0800") Message-ID: <87ee9i6n1w.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Weizhao Ouyang writes: > On 2021/9/21 15:07, Huang, Ying wrote: >> Weizhao Ouyang writes: >> >>> Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. >>> >>> Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") >>> Signed-off-by: Weizhao Ouyang >>> Reviewed-by: "Huang, Ying" >>> --- >>> include/linux/migrate.h | 6 +++++- >>> mm/debug.c | 1 + >>> 2 files changed, 6 insertions(+), 1 deletion(-) >>> >>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h >>> index 326250996b4e..c8077e936691 100644 >>> --- a/include/linux/migrate.h >>> +++ b/include/linux/migrate.h >>> @@ -19,6 +19,11 @@ struct migration_target_control; >>> */ >>> #define MIGRATEPAGE_SUCCESS 0 >>> >>> +/* >>> + * Keep sync with: >>> + * - macro MIGRATE_REASON in include/trace/events/migrate.h >>> + * - migrate_reason_names[MR_TYPES] in mm/debug.c >>> + */ >>> enum migrate_reason { >>> MR_COMPACTION, >>> MR_MEMORY_FAILURE, >>> @@ -32,7 +37,6 @@ enum migrate_reason { >>> MR_TYPES >>> }; >>> >>> -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ >>> extern const char *migrate_reason_names[MR_TYPES]; >>> >>> #ifdef CONFIG_MIGRATION >>> diff --git a/mm/debug.c b/mm/debug.c >>> index e61037cded98..fae0f81ad831 100644 >>> --- a/mm/debug.c >>> +++ b/mm/debug.c >>> @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { >>> "numa_misplaced", >>> "contig_range", >>> "longterm_pin", >>> + "demotion", >>> }; >>> >>> const struct trace_print_flags pageflag_names[] = { >> Can we add BUILD_BUG_ON() somewhere to capture at least some >> synchronization issue? > > Hi Huang, we discussed this in the v1 thread with you and John, seems you > missed it. Now we just add a comment to do the synchronization, and we can > figure out a more general way to use strings which in trace_events straight. Got it! And I think we can add the BUILD_BUG_ON() now and delete it when we have a better solution to deal with that. But if you can work out a better solution quickly, that's fine to ignore this. Best Regards, Huang, Ying