Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1011416pxb; Fri, 22 Jan 2021 05:12:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWhaGGvMs2EnY2t6gnnIBgXpVP0IgCS1VVgcwNujyFqIamaWIzTsIuld+9o52CLFnQnkQq X-Received: by 2002:a17:906:690:: with SMTP id u16mr2991335ejb.186.1611321145869; Fri, 22 Jan 2021 05:12:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611321145; cv=none; d=google.com; s=arc-20160816; b=IyjR95ZCacVosfbl7eMcID4DNIOs+oOWWEv4feRMnnyl1MmP64S7+k72OmX9G30z+O 0LOkSYfnTrl2YR2mS9LMufd16zgIxREWKyGOSRcRfNOJzo5nYT7HYDptHFuRVGOmdmvO WgidPnT6gN3T7XpchCDT6RLjpPGR11PSGPc6DNFBSP5wvMI0F1Mzp2//hBxwysGgj62H 4m7oSDYXQas3DxtKzizaud/jfuqJlEAnw13TVqKMkmePF6jBY2Nk3YUUHJXtM6z9e1QC c+NDL8JnpmsTpMXfXq8nbaHs5GFu9GnZ/ZStLN0Nn2Z2InV1cAfqaJ8vENqDnGpoynMX VLig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jM6zpCES+0HLn8XlUNi032+O57IMQ4RlIhY5sPMlY+Q=; b=Nd9QMOvcvYhJ3hhUCf9LbGAnUI2U/GFEuRiVeTMWTik6xfJZu8fuyWnAVsMVw5FnzB 7M4DTBr7+zjAvVuQBl+8qnPQqMmmX1baTM7uEUgHsV2Pn7/8zYrPYeTRQkP4drDZZDlu XCFBs+3FChA0DZL0gV1X9MhmSPMet0blGIirpYL8t+6qeM7rnym641oUeiUsJk/bzHCx Us/C7einAIfvmdKSPA+LldD0uQ5uU+xxQAAOdoauTgkZP9a7QJb7f/IN60LehkX+xS4V d5+H41dM2tEL0s6tmkLpZQ4aaWM3prCT4je5RzctcsUDMBnB5m3UkxQt7VAjQJj0j57b kYVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sF5zAjDT; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si2961609ejc.352.2021.01.22.05.11.59; Fri, 22 Jan 2021 05:12:25 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=sF5zAjDT; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727994AbhAVNLJ (ORCPT + 99 others); Fri, 22 Jan 2021 08:11:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727476AbhAVNKm (ORCPT ); Fri, 22 Jan 2021 08:10:42 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B2A4C061786 for ; Fri, 22 Jan 2021 05:10:02 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id v67so7467378lfa.0 for ; Fri, 22 Jan 2021 05:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jM6zpCES+0HLn8XlUNi032+O57IMQ4RlIhY5sPMlY+Q=; b=sF5zAjDT56BXiHUey17OUSfQJ66O9gcNB/c6sn5CjzVA/TG8uudCB1ttxC7JwOpY3K qIB1A5e7fuCatdIf+5BL5DYq0UuC+ftUgAIEvi3YC5xTK9SBTvWSgrFOBn0lRFms7Xws 9YSdzTRVxlR3bmUlTGBzpMETm64mfRVCQkQ2LEL/+zTbIQSLC1MxJyX0y0/Mku+Uwr+g Po0AbrD406ZbDdueebjDmUt49f7PZoFwWFK/6oIhfRGB6J3GePuH//HPXFcypYtsnNGg teRWxa9ynMonmK9sWmd+YcmJci32W7kQOXEDs5ju0ygcEo5dtXPSYY9zqvnhGp+PNLCC bk/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jM6zpCES+0HLn8XlUNi032+O57IMQ4RlIhY5sPMlY+Q=; b=lzk+/HQJKlfb7jwhUk4fU+m4QaQTx6fRFJ3U24+WAPTpsyXnraOg7wdy/PhEnA08Cl 4o676zm4WHDxvuMFuOO2QVdh0Bk0nrYlG2takuYhs2FPvoPrJfMUIPFBHx2LfxxYLh7Q zkZJgalCpTdZR/yCnfeUbxENbtiQoMWQpdSJTD55SfVaZyIMe4JD/tN/YU3en+X1bn8C fulIeCgLds9FOwQFCEwI3lNYf7uedPReaOeOtLx2rNMwaKt7Tdtwm3frXExdam+kSow7 x4R1n8/cJH6oQ0vaVxo4QdpInqpgze03fzpOHoti6hsXAsa/sfp+Fl3/hadqfOJ6g/pI twkA== X-Gm-Message-State: AOAM533poTVGXy6Y0EFUrUjU0ox+ao113rliIvhAaPKkw+ueD33YmawS D/fEDAw3srOdq4GX+TFYsfklWjcWZlF1MbudF98QcA== X-Received: by 2002:a05:6512:38c1:: with SMTP id p1mr2197526lft.193.1611321000384; Fri, 22 Jan 2021 05:10:00 -0800 (PST) MIME-Version: 1.0 References: <20201118082759.1413056-1-bharata@linux.ibm.com> <20210121053003.GB2587010@in.ibm.com> In-Reply-To: From: Jann Horn Date: Fri, 22 Jan 2021 14:09:33 +0100 Message-ID: Subject: Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order To: Vlastimil Babka Cc: Christoph Lameter , Bharata B Rao , Vincent Guittot , linux-kernel , Linux-MM , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Shakeel Butt , Johannes Weiner , aneesh.kumar@linux.ibm.com, Michal Hocko Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 2:05 PM Jann Horn wrote: > On Thu, Jan 21, 2021 at 7:19 PM Vlastimil Babka wrote: > > On 1/21/21 11:01 AM, Christoph Lameter wrote: > > > On Thu, 21 Jan 2021, Bharata B Rao wrote: > > > > > >> > The problem is that calculate_order() is called a number of times > > >> > before secondaries CPUs are booted and it returns 1 instead of 224. > > >> > This makes the use of num_online_cpus() irrelevant for those cases > > >> > > > >> > After adding in my command line "slub_min_objects=36" which equals to > > >> > 4 * (fls(num_online_cpus()) + 1) with a correct num_online_cpus == 224 > > >> > , the regression diseapears: > > >> > > > >> > 9 iterations of hackbench -l 16000 -g 16: 3.201sec (+/- 0.90%) > > > > I'm surprised that hackbench is that sensitive to slab performance, anyway. It's > > supposed to be a scheduler benchmark? What exactly is going on? > > Uuuh, I think powerpc doesn't have cmpxchg_double? > > "vgrep cmpxchg_double arch/" just spits out arm64, s390 and x86? And > > says under "POWERPC": "no DW LL/SC" > > So powerpc is probably hitting the page-bitlock-based implementation > all the time for stuff like __slub_free()? Do you have detailed > profiling results from "perf top" or something like that? > > (I actually have some WIP patches and a design document for getting > rid of cmpxchg_double in struct page that I hacked together in the > last couple days; I'm currently in the process of sending them over to > some other folks in the company who hopefully have cycles to > review/polish/benchmark them so that they can be upstreamed, assuming > that those folks think they're important enough. I don't have the > cycles for it...) (The stuff I have in mind will only work on 64-bit though. We are talking about PPC64 here, right?)