Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp394271ybm; Mon, 20 May 2019 18:48:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1jsFvgbpjkbYt2SdlZlrN4n06SyqArrOO1kDBOtStnAQ1KHgshmdSIQDAeEQ8GU7CSnkw X-Received: by 2002:a17:902:6bcb:: with SMTP id m11mr9621797plt.318.1558403293935; Mon, 20 May 2019 18:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558403293; cv=none; d=google.com; s=arc-20160816; b=JGFJAck9hGpgsHI4iZUy1OyVB3zc4Nby9tf8CfEqhbAwZzakOm/lU/WQIUP2UcAiH3 4cU/JXkD7raXQxRxZoQiZW7Y5rqiQASXLdry2+G5qyD4891YvzQGx0kSNuFEjMXITU+j yDxzfN5orWhXlx80imd1pTiqLPKQQYxd/Nc9z0expLjnmp+of3wE2wg0kXzof7dJeijY YR8RD8zCZW3uFm9gAfBwHBtEUCgNEEacjtS2G3S7R/hVqC2OC3J8CyYLKR/zuPxzh4pC EIjvlRMX0Mn9o2RgAtp28pQ+v6yiFwY8s8g3m18esKqu8DsgEFI89WPXC0TAF52DXURG hUwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=zSyPy+Mn5LVlJ+FlCj33Ng1Vj0N3aj5sXaJqqEQXdJg=; b=PaFT2SBRauwdAxP3ZBnet7HtcGLr1SwZfREJZ1OGHwVj7jYqhktI5yNbM5OfX1Ugrn OkGZgQg0jUd+5RsR6kpLIg3FXihPcOnWNvLMR2iqhH2o6IbAVV69nOdNGcZx95yl27Az MTxSFmizhRcqSMiLbmyWE6nhJCKlddz0U7xxlNl7ECXR+rgxI430+oSDKl/z12Y9ovw6 fIANINTWg47+zTzRAn/givJyDWSfyamEjORuaA7ps2LTYc9wov61hp4Roj4mchM+DwFn iIbRmF+40DUdRj550CAnH1p4eZM7IN7yIW4jx84+0cFFAdAEZbwQvT6+u7uGUO7qj9Vm WjNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm3 header.b=aVzZIMke; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=wogBIOI9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16si1789719pgh.549.2019.05.20.18.47.58; Mon, 20 May 2019 18:48:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm3 header.b=aVzZIMke; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=wogBIOI9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727619AbfEUBpm (ORCPT + 99 others); Mon, 20 May 2019 21:45:42 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:56245 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727511AbfEUBpl (ORCPT ); Mon, 20 May 2019 21:45:41 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id ADF3BBFD1; Mon, 20 May 2019 21:45:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 20 May 2019 21:45:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobin.cc; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=zSyPy+Mn5LVlJ+FlCj33Ng1Vj0N 3aj5sXaJqqEQXdJg=; b=aVzZIMke8RgIn6fgRezyJIRNTdJNmy5BsAfcf1rzNh9 kfmmri+unp7PyZsnxtkTgHSaodOlSW0TTlKw/4fzSUEUmmtotFcMflrouEawmetl yMmjYklNKZ2LGYBcwcppzbcYXLRiwTA4QcWSB/ZX7H9FsqXPJxD/cRXvqR7HSnbl zmsZE4Ph1MtGXYkMjSGtQYC7AFO14uXoLyZbbHwa5QkUlBhb3yBrrCFILt19iBEf kwl8tl11sbo2aN+IhYgJFA3CPgZgs+3qDPLfVBdw4eJznoV2b2tluB4D4CqOi8Cz 8hEcWr+0tr06AIlzR9mIdoTTxdmg5oLtQIMgMM4lQRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zSyPy+ Mn5LVlJ+FlCj33Ng1Vj0N3aj5sXaJqqEQXdJg=; b=wogBIOI9ILp8CO+jyYf2m/ 4O6hf7ZDRufCxFGdAvGp6xsRPd+RZznXygF6h6C8FzaK2UCm+jexQBRPR5a036PZ ragLxfROMNdB/0r9JMwaS38EjvpdLnYb6fIAMRTYkPNQkcbQryDr2NjG42OxjcBW byUfI68V1yvb882goJR9nc6oZZ2w4KokjWRhkD9kaYfk1ROH6zxZnlbBDN2gDvJO 7blXnkWpM6kS89cTpb9wYgh63AMAU4w6AKN4L9TLTCXZXNm6HDKxrTN6+h/1QAZv nk5lOnZ1kaxo4AMVAoe6nuYv6JnFpbD1aDar6wzuzMu+RpE4pza1gfrJUfw8GXDw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtledggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvuffkfhggtggujgfofgesthdtredt ofervdenucfhrhhomhepfdfvohgsihhnucevrdcujfgrrhguihhnghdfuceomhgvsehtoh gsihhnrdgttgeqnecukfhppeduvdegrdduieelrdduheeirddvtdefnecurfgrrhgrmhep mhgrihhlfhhrohhmpehmvgesthhosghinhdrtggtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (124-169-156-203.dyn.iinet.net.au [124.169.156.203]) by mail.messagingengine.com (Postfix) with ESMTPA id B78C810378; Mon, 20 May 2019 21:45:35 -0400 (EDT) Date: Tue, 21 May 2019 11:44:57 +1000 From: "Tobin C. Harding" To: Roman Gushchin Cc: "Tobin C. Harding" , Andrew Morton , Matthew Wilcox , Alexander Viro , Christoph Hellwig , Pekka Enberg , David Rientjes , Joonsoo Kim , Christopher Lameter , Miklos Szeredi , Andreas Dilger , Waiman Long , Tycho Andersen , Theodore Ts'o , Andi Kleen , David Chinner , Nick Piggin , Rik van Riel , Hugh Dickins , Jonathan Corbet , "linux-mm@kvack.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH v5 13/16] slub: Enable balancing slabs across nodes Message-ID: <20190521014457.GA27676@eros.localdomain> References: <20190520054017.32299-1-tobin@kernel.org> <20190520054017.32299-14-tobin@kernel.org> <20190521010404.GB9552@tower.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190521010404.GB9552@tower.DHCP.thefacebook.com> X-Mailer: Mutt 1.11.4 (2019-03-13) User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 01:04:10AM +0000, Roman Gushchin wrote: > On Mon, May 20, 2019 at 03:40:14PM +1000, Tobin C. Harding wrote: > > We have just implemented Slab Movable Objects (SMO). On NUMA systems > > slabs can become unbalanced i.e. many slabs on one node while other > > nodes have few slabs. Using SMO we can balance the slabs across all > > the nodes. > > > > The algorithm used is as follows: > > > > 1. Move all objects to node 0 (this has the effect of defragmenting the > > cache). > > This already sounds dangerous (or costly). Can't it be done without > cross-node data moves? > > > > > 2. Calculate the desired number of slabs for each node (this is done > > using the approximation nr_slabs / nr_nodes). > > So that on this step only (actual data size - desired data size) has > to be moved? This is just the most braindead algorithm I could come up with. Surely there are a bunch of things that could be improved. Since I don't know the exact use case it seemed best not to optimize for any one use case. I'll review, comment on, and test any algorithm you come up with! thanks, Tobin.