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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09215C433E2 for ; Mon, 22 Jun 2020 15:37:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC84C2071A for ; Mon, 22 Jun 2020 15:37:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC84C2071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6A6796B0007; Mon, 22 Jun 2020 11:37:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 631A76B0008; Mon, 22 Jun 2020 11:37:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 546736B000A; Mon, 22 Jun 2020 11:37:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 39B8E6B0007 for ; Mon, 22 Jun 2020 11:37:23 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E9380123721 for ; Mon, 22 Jun 2020 15:37:22 +0000 (UTC) X-FDA: 76957251924.17.ant97_3d0a7f426e34 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 945441804824B for ; Mon, 22 Jun 2020 15:37:22 +0000 (UTC) X-HE-Tag: ant97_3d0a7f426e34 X-Filterd-Recvd-Size: 7226 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Mon, 22 Jun 2020 15:37:22 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id l10so17158468wrr.10 for ; Mon, 22 Jun 2020 08:37:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xiJ5TZjSRnSbkwESwPasgJWLT9F9zu3NMWdA7xdTANU=; b=X8b5TP0Zzyqwqrqfj1GhcqKYOeWwXZcek5s9rYv/JTqgLxh0pPaOoTsTGrJAoRH/LW gFYfGcARrlV5KcmJaUMUvaknZvLAKLPj9etZ1oC2p9ClVXz1a/WECzrhWu+y65H49b3U 8DvbRfcjGPmDt/sLVuziAa3n953n0kMgTP1z3vAYPjgoSyCCed7sUzW7uiSEArD5whXg HonquHFK9uXvbVG28GNEggYV78La6VLVnFfs2kA0NLwyjOymuS5j2W8zZSeKecbLIvm1 k4ZjJ1mW+jqO64fpxtuiLwKLis6KotbJxl+ac0sxXVTG5g2tht1tzGGWpB/xqd6iuEbp 0YGA== X-Gm-Message-State: AOAM532CsZ99pmx5gVJ6RGwxnalLuqGN+9z+VZM8Y2AVurJGT3qSnX6g cKaBhkIhaxF0COQvR6cbVGk= X-Google-Smtp-Source: ABdhPJxK5y2wIis0CHcxEXbB3wQ7gwgnUyqHchK/etrSgy/TSoi/MZM30ajjys2QFNc1qNU5mlXbTw== X-Received: by 2002:adf:f14e:: with SMTP id y14mr19658661wro.151.1592840240912; Mon, 22 Jun 2020 08:37:20 -0700 (PDT) Received: from localhost (ip-37-188-173-135.eurotel.cz. [37.188.173.135]) by smtp.gmail.com with ESMTPSA id w14sm18498114wrt.55.2020.06.22.08.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 08:37:20 -0700 (PDT) Date: Mon, 22 Jun 2020 17:37:19 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Minchan Kim , Huang Ying , Wei Yang , Mel Gorman , Dan Williams Subject: Re: [PATCH v2 3/3] mm/shuffle: remove dynamic reconfiguration Message-ID: <20200622153719.GI31426@dhcp22.suse.cz> References: <20200619125923.22602-1-david@redhat.com> <20200619125923.22602-4-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200619125923.22602-4-david@redhat.com> X-Rspamd-Queue-Id: 945441804824B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 Fri 19-06-20 14:59:22, David Hildenbrand wrote: > Commit e900a918b098 ("mm: shuffle initial free memory to improve > memory-side-cache utilization") promised "autodetection of a > memory-side-cache (to be added in a follow-on patch)" over a year ago. > > The original series included patches [1], however, they were dropped > during review [2] to be followed-up later. > > Due to lack of platforms that publish an HMAT, autodetection is currently > not implemented. However, manual activation is actively used [3]. Let's > simplify for now and re-add when really (ever?) needed. > > [1] https://lkml.kernel.org/r/154510700291.1941238.817190985966612531.stgit@dwillia2-desk3.amr.corp.intel.com > [2] https://lkml.kernel.org/r/154690326478.676627.103843791978176914.stgit@dwillia2-desk3.amr.corp.intel.com > [3] https://lkml.kernel.org/r/CAPcyv4irwGUU2x+c6b4L=KbB1dnasNKaaZd6oSpYjL9kfsnROQ@mail.gmail.com > > Cc: Andrew Morton > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Minchan Kim > Cc: Huang Ying > Cc: Wei Yang > Cc: Mel Gorman > Cc: Dan Williams > Signed-off-by: David Hildenbrand Acked-by: Michal Hocko > --- > mm/shuffle.c | 28 ++-------------------------- > mm/shuffle.h | 17 ----------------- > 2 files changed, 2 insertions(+), 43 deletions(-) > > diff --git a/mm/shuffle.c b/mm/shuffle.c > index dd13ab851b3ee..9b5cd4b004b0f 100644 > --- a/mm/shuffle.c > +++ b/mm/shuffle.c > @@ -10,33 +10,11 @@ > #include "shuffle.h" > > DEFINE_STATIC_KEY_FALSE(page_alloc_shuffle_key); > -static unsigned long shuffle_state __ro_after_init; > - > -/* > - * Depending on the architecture, module parameter parsing may run > - * before, or after the cache detection. SHUFFLE_FORCE_DISABLE prevents, > - * or reverts the enabling of the shuffle implementation. SHUFFLE_ENABLE > - * attempts to turn on the implementation, but aborts if it finds > - * SHUFFLE_FORCE_DISABLE already set. > - */ > -__meminit void page_alloc_shuffle(enum mm_shuffle_ctl ctl) > -{ > - if (ctl == SHUFFLE_FORCE_DISABLE) > - set_bit(SHUFFLE_FORCE_DISABLE, &shuffle_state); > - > - if (test_bit(SHUFFLE_FORCE_DISABLE, &shuffle_state)) { > - if (test_and_clear_bit(SHUFFLE_ENABLE, &shuffle_state)) > - static_branch_disable(&page_alloc_shuffle_key); > - } else if (ctl == SHUFFLE_ENABLE > - && !test_and_set_bit(SHUFFLE_ENABLE, &shuffle_state)) > - static_branch_enable(&page_alloc_shuffle_key); > -} > > static bool shuffle_param; > static int shuffle_show(char *buffer, const struct kernel_param *kp) > { > - return sprintf(buffer, "%c\n", test_bit(SHUFFLE_ENABLE, &shuffle_state) > - ? 'Y' : 'N'); > + return sprintf(buffer, "%c\n", shuffle_param ? 'Y' : 'N'); > } > > static __meminit int shuffle_store(const char *val, > @@ -47,9 +25,7 @@ static __meminit int shuffle_store(const char *val, > if (rc < 0) > return rc; > if (shuffle_param) > - page_alloc_shuffle(SHUFFLE_ENABLE); > - else > - page_alloc_shuffle(SHUFFLE_FORCE_DISABLE); > + static_branch_enable(&page_alloc_shuffle_key); > return 0; > } > module_param_call(shuffle, shuffle_store, shuffle_show, &shuffle_param, 0400); > diff --git a/mm/shuffle.h b/mm/shuffle.h > index 4d79f03b6658f..71b784f0b7c3e 100644 > --- a/mm/shuffle.h > +++ b/mm/shuffle.h > @@ -4,23 +4,10 @@ > #define _MM_SHUFFLE_H > #include > > -/* > - * SHUFFLE_ENABLE is called from the command line enabling path, or by > - * platform-firmware enabling that indicates the presence of a > - * direct-mapped memory-side-cache. SHUFFLE_FORCE_DISABLE is called from > - * the command line path and overrides any previous or future > - * SHUFFLE_ENABLE. > - */ > -enum mm_shuffle_ctl { > - SHUFFLE_ENABLE, > - SHUFFLE_FORCE_DISABLE, > -}; > - > #define SHUFFLE_ORDER (MAX_ORDER-1) > > #ifdef CONFIG_SHUFFLE_PAGE_ALLOCATOR > DECLARE_STATIC_KEY_FALSE(page_alloc_shuffle_key); > -extern void page_alloc_shuffle(enum mm_shuffle_ctl ctl); > extern void __shuffle_free_memory(pg_data_t *pgdat); > extern bool shuffle_pick_tail(void); > static inline void shuffle_free_memory(pg_data_t *pgdat) > @@ -58,10 +45,6 @@ static inline void shuffle_zone(struct zone *z) > { > } > > -static inline void page_alloc_shuffle(enum mm_shuffle_ctl ctl) > -{ > -} > - > static inline bool is_shuffle_order(int order) > { > return false; > -- > 2.26.2 -- Michal Hocko SUSE Labs