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=-19.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL 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 AC7ABC5519F for ; Wed, 18 Nov 2020 19:53:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2368B2225E for ; Wed, 18 Nov 2020 19:53:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bDEBYC40" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2368B2225E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 85B936B005D; Wed, 18 Nov 2020 14:53:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 810216B0068; Wed, 18 Nov 2020 14:53:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6884B6B006C; Wed, 18 Nov 2020 14:53:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 3807F6B005D for ; Wed, 18 Nov 2020 14:53:50 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CF4E1180AD820 for ; Wed, 18 Nov 2020 19:53:49 +0000 (UTC) X-FDA: 77498589378.24.shake38_3c109742733c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id B288A1A4A7 for ; Wed, 18 Nov 2020 19:53:49 +0000 (UTC) X-HE-Tag: shake38_3c109742733c X-Filterd-Recvd-Size: 5387 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Nov 2020 19:53:49 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id q10so2149299pfn.0 for ; Wed, 18 Nov 2020 11:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Nv1lrpdhsNV5qrzQebFMOG5OIfE6xbhYHuZs96YR+FM=; b=bDEBYC40hgqvmqxbaEKtvckc6NvT/RbCEYuDgJ9aEWvhiRs16BNuSs693ZPg40EwrV LQrgGY/iJ6tdNiWJzQX+8n0UwclQRCqEU61x/024gocsOTLyKjh8jgufMVVUXlMSbUqy WO6kLbO8YYHN50EbiLUp71HaGHDhswJr8zf+cYE5iGpeWs/4AKwFkRQ0iibEJub9u08P RfUL4XUhKL9dIWlcnQ4uU40oPJRE4109tDViD/K/mZuYoCq0vNlFhmgr2QUHQ6X9CNXA B6rw7Leec6zoAx3qh7jeY+C82oynkZGJXo36kyH+x1KzsKcR3mg9zr34CznnQm+ClFYr lStQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=Nv1lrpdhsNV5qrzQebFMOG5OIfE6xbhYHuZs96YR+FM=; b=FfMIn2Z3ClZKwoylDWmQA8K/zs0lcBDyOSBAhJc4omABbMofBgpvtEwGsBPJirwRNM qII//AhBgEDYlEh4qbBVjmburq6B2H3tc8l1KCvOxbLXgUOyQ+nXprILMPXiHsbYIFmE coo5Ec2Engu3ANYvzBA5jeg4Kox1OalP2kYopcas94v+PqorfgvX+UjWi+fWAkqUYlF6 c3G4LN2vqsmHrR+tB1YUizFZ9pOiimaRtCq+xohP8inKj1rwdttgTcq2ns+b91giVHvf oHtYKCsaBnjWsKui5F2KoJYWQmWinXwl3inrjkZjSzngEy6iwZ81HOjtF+S4RF4ztp9Y TsTA== X-Gm-Message-State: AOAM531V72/E1yQejz4UOvljUEwl1AMPLIlKHpjm2O67BnDBVXaxdfOl u1sASGoSP4IkXYL2e6oEahBwQQ== X-Google-Smtp-Source: ABdhPJy1Lr/VhmQiOIIOOdBdn0L5HHiRUxFJwMAPMpCWzaYxHigh46zSKk3LLQ5VrRtLGn0HNnpyYg== X-Received: by 2002:a62:52d7:0:b029:18b:7093:fb88 with SMTP id g206-20020a6252d70000b029018b7093fb88mr6145068pfb.76.1605729228003; Wed, 18 Nov 2020 11:53:48 -0800 (PST) Received: from [2620:15c:17:3:4a0f:cfff:fe51:6667] ([2620:15c:17:3:4a0f:cfff:fe51:6667]) by smtp.gmail.com with ESMTPSA id a12sm3264030pjh.48.2020.11.18.11.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:53:47 -0800 (PST) Date: Wed, 18 Nov 2020 11:53:46 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Roman Gushchin cc: Vlastimil Babka , Bharata B Rao , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cl@linux.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, shakeelb@google.com, hannes@cmpxchg.org, aneesh.kumar@linux.ibm.com Subject: Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order In-Reply-To: <20201118193446.GC186396@carbon.dhcp.thefacebook.com> Message-ID: References: <20201118082759.1413056-1-bharata@linux.ibm.com> <9e1a2e2b-1b3c-9587-9b74-8ed8300fcb98@suse.cz> <20201118193446.GC186396@carbon.dhcp.thefacebook.com> User-Agent: Alpine 2.23 (DEB 453 2020-06-18) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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, 18 Nov 2020, Roman Gushchin wrote: > On Wed, Nov 18, 2020 at 12:25:38PM +0100, Vlastimil Babka wrote: > > On 11/18/20 9:27 AM, Bharata B Rao wrote: > > > The page order of the slab that gets chosen for a given slab > > > cache depends on the number of objects that can be fit in the > > > slab while meeting other requirements. We start with a value > > > of minimum objects based on nr_cpu_ids that is driven by > > > possible number of CPUs and hence could be higher than the > > > actual number of CPUs present in the system. This leads to > > > calculate_order() chosing a page order that is on the higher > > > side leading to increased slab memory consumption on systems > > > that have bigger page sizes. > > > > > > Hence rely on the number of online CPUs when determining the > > > mininum objects, thereby increasing the chances of chosing > > > a lower conservative page order for the slab. > > > > > > Signed-off-by: Bharata B Rao > > > > Acked-by: Vlastimil Babka > > > > Ideally, we would react to hotplug events and update existing caches > > accordingly. But for that, recalculation of order for existing caches would > > have to be made safe, while not affecting hot paths. We have removed the > > sysfs interface with 32a6f409b693 ("mm, slub: remove runtime allocation > > order changes") as it didn't seem easy and worth the trouble. > > > > In case somebody wants to start with a large order right from the boot > > because they know they will hotplug lots of cpus later, they can use > > slub_min_objects= boot param to override this heuristic. So in case this > > change regresses somebody's performance, there's a way around it and thus > > the risk is low IMHO. > > I agree. For the absolute majority of users there will be no difference. > And there is a good workaround for the rest. > > Acked-by: Roman Gushchin > Acked-by: David Rientjes