Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1001513pxu; Wed, 6 Jan 2021 09:43:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWtaPP3IpuI7nIxnw0wkHMkv0fKBdjQ54aRg+y1hPsUNVkF+2FYiR1gmtOSHa1tpXdCp/p X-Received: by 2002:a05:6402:95c:: with SMTP id h28mr4679375edz.26.1609955004452; Wed, 06 Jan 2021 09:43:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609955004; cv=none; d=google.com; s=arc-20160816; b=JbWs3B+Kk3XreqXZyFLivQ9o8LKsbxarTitMHfbcdCNSCEisQ1vKWK+h6w26HtoUWJ P5U/F9LAbW/wqpxBZH04fixpt1bWQGwRV8i0v+EFLU+Je3xxRWVYwUju+xH6s2OMk+1q vLFwTNRjSO/JVkomzV/ySeL+9bWituVIjp2Zhd9a0ruMMgBBKYpN7edfX/OMsLd/WqbO y+TEf/vSMRT+yAKXRqO5F4W+xnJqDaR9TxhL9iNTxv4Fvnu+CfhSrxn/1cPeodeXOr4O WWCxZmWDIbOac0chwalzi3eKiHg5uUAPJ5wa58wcODrgl8tlrNy/D1vXYNx9KLzhDFTk wgmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=lNnbG8dTwyDJvi0EUNmsyAGPfWcu6WbI3qvp9rT6QQs=; b=f0WC3EEYi/gtGxP44c7unLxIbVfSugJni8pWif9PKWO5ag8QSd3b4FtVxxZQ45TARs qrCmh9jr1S9/zJAUb98voTyfGCF79KtVw83jEM4ymfI+YismJ1j+ILkrsOdyLLDBIrJw R5ECuMHWfe1MO10p/beHG7s1gmMMTvxrc3PFbUzldg/EXU1uw7C72WeYKWeAtiZJsgTK 5DLPYcWn04rkcarmqSFVgtwowdcnpk2Hlk/a2Idmre4XRKUrmspaZ4W7ZlNM8NzOWYKc fLxz/DpGmTgWb7vzk91pWt6CikZuc/8VYFt5O+KtCzsZbKKkr9uiga7JILMCnwURJKE2 miKw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kq6si1105857ejb.300.2021.01.06.09.43.01; Wed, 06 Jan 2021 09:43:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726682AbhAFRlZ (ORCPT + 99 others); Wed, 6 Jan 2021 12:41:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:43806 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbhAFRlY (ORCPT ); Wed, 6 Jan 2021 12:41:24 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 92CD9AD64; Wed, 6 Jan 2021 17:40:43 +0000 (UTC) From: Vlastimil Babka To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vladimir Davydov , Qian Cai , David Hildenbrand , Michal Hocko , Vlastimil Babka Subject: [RFC 0/3] mm, slab, slub: remove cpu and memory hotplug locks Date: Wed, 6 Jan 2021 18:40:26 +0100 Message-Id: <20210106174029.12654-1-vbabka@suse.cz> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, some related work caused me to look at how we use get/put_mems_online() and get/put_online_cpus() during kmem cache creation/descruction/shrinking, and realize that it should be actually safe to remove all of that with rather small effort (as e.g. Michal Hocko suspected in some of the past discussions already). This has the benefit to avoid rather heavy locks that have caused locking order issues already in the past. So this is the result, Patches 1 and 2 remove memory hotplug and cpu hotplug locking, respectively. Patch 3 is due to realization that in fact some races exist despite the locks (even if not removed), but the most sane solution is not to introduce more of them, but rather accept some wasted memory in scenarios that should be rare anyway (full memory hot remove), as we do the same in other contexts already. It's all RFC for now, as I might have missed some reason why it's not safe. Vlastimil Babka (3): mm, slab, slub: stop taking memory hotplug lock mm, slab, slub: stop taking cpu hotplug lock mm, slub: stop freeing kmem_cache_node structures on node offline mm/slab_common.c | 20 ++++-------------- mm/slub.c | 54 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 34 deletions(-) -- 2.29.2