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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F243C00140 for ; Wed, 24 Aug 2022 16:25:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 418DA940007; Wed, 24 Aug 2022 12:25:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C8546B0074; Wed, 24 Aug 2022 12:25:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 290FC940007; Wed, 24 Aug 2022 12:25:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1958E6B0073 for ; Wed, 24 Aug 2022 12:25:32 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id EB0B040AE4 for ; Wed, 24 Aug 2022 16:25:31 +0000 (UTC) X-FDA: 79835011662.14.BDD1A7C Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf17.hostedemail.com (Postfix) with ESMTP id 81F8240020 for ; Wed, 24 Aug 2022 16:25:30 +0000 (UTC) Date: Wed, 24 Aug 2022 18:25:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1661358328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DcAq+EGa2JBcnvmLii0/KS01sMRULYrxXJ6rPB69T5w=; b=XZ8usYtORfMRBC/9neZC1BytFtkbFEuaCuWHT3jORcse4Lh1IWUEXOqi5WqbFzoyrr3en5 ANCYMkaLj6zoSfYIjKaiVz8aIfUCjnoFhqP8gsLNW6naXYf7Y7uQZlZm5/DjS1iqQCqzGu VcXD4SM7dzsKf5v10Mswh5PW2Je24MXSf09G2yOz64SWo+fml0QD/1saNIfddzQU0TsYZ+ g7Thm+9uQpLZnKjS+GfHKAU6STPjrhMXFZmuJLX022xCPzP7WgXvTyJk5pletLoPTamtXv rJiP1iGu3GIUjn5QLAmNmMyyDLZoVIW+umAEza4x3a5UBmLW3Nj9JscESgCFWg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1661358328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DcAq+EGa2JBcnvmLii0/KS01sMRULYrxXJ6rPB69T5w=; b=aLhGqzKoqglO6M5LeRzwfol68vq9uyOtO4WiYiNaopKMndYT/gGKFYgKfxLwevsufPgaB1 gbUjABlMB6372cDg== From: Sebastian Andrzej Siewior To: Vlastimil Babka Cc: Rongwei Wang , Christoph Lameter , Joonsoo Kim , David Rientjes , Pekka Enberg , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , linux-mm@kvack.org, Thomas Gleixner , Mike Galbraith Subject: Re: [PATCH v2 5/5] mm/slub: simplify __cmpxchg_double_slab() and slab_[un]lock() Message-ID: References: <20220823170400.26546-1-vbabka@suse.cz> <20220823170400.26546-6-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220823170400.26546-6-vbabka@suse.cz> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661358330; a=rsa-sha256; cv=none; b=q7yU0+TVwTtxPfazBxo8T6P7vzETcf/oYnTT6L7SaS5EvhNTpba3dC27h0wRF50Nw4TAz8 JVy2PPkxistok/BHBNNYD2y/XrDzlFjGWgpZMNzSbYXUuK0Z4EhQfpkLbXLmBzE9iIaY1q z44AKDZC/FvppY7csG5KnAFoY/AlCy0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=XZ8usYtO; dkim=pass header.d=linutronix.de header.s=2020e header.b=aLhGqzKo; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf17.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661358330; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DcAq+EGa2JBcnvmLii0/KS01sMRULYrxXJ6rPB69T5w=; b=oywksthBUzYl2MkZithwx9W3thLN59Aqi/ORZLRlCBlxlGOPre5I9ahVyi0qmbWu+AEd5j BJCRPuoOGcC0lz0cT/gORSpc+qnQoLn0bdeG2Wafzbcwa9H4ryTRrBQkgZgphOBkj+6mmj myuyou9FN7rOQE6dJvHBZXY/Dotpk0w= X-Stat-Signature: u837qdexoj5nmotkf6grnogzbm8j5xfa X-Rspamd-Queue-Id: 81F8240020 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=XZ8usYtO; dkim=pass header.d=linutronix.de header.s=2020e header.b=aLhGqzKo; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf17.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1661358330-810938 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 2022-08-23 19:04:00 [+0200], Vlastimil Babka wrote: > The PREEMPT_RT specific disabling of irqs in __cmpxchg_double_slab() > (through slab_[un]lock()) is unnecessary as bit_spin_lock() disables > preemption and that's sufficient on RT where interrupts are threaded. maybe something like=20 "=E2=80=A6 sufficient on PREEMPT_RT where no allocation/ free operation is performed in hardirq context and so interrupt the current operation." > That means we no longer need the slab_[un]lock() wrappers, so delete > them and rename the current __slab_[un]lock() to slab_[un]lock(). >=20 > Signed-off-by: Vlastimil Babka > Acked-by: David Rientjes Reviewed-by: Sebastian Andrzej Siewior > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -454,7 +454,7 @@ static __always_inline void __slab_lock(struct slab *= slab) =E2=80=A6 > /* > * Interrupts must be disabled (for the fallback code to work right), ty= pically > - * by an _irqsave() lock variant. Except on PREEMPT_RT where locks are d= ifferent > - * so we disable interrupts as part of slab_[un]lock(). > + * by an _irqsave() lock variant. Except on PREEMPT_RT where these varia= nts do > + * not actually disable interrupts. On the other hand the migrate_disabl= e() > + * done by bit_spin_lock() is sufficient on PREEMPT_RT thanks to its thr= eaded > + * interrupts. " On PREEMPT_RT the preempt_disable(), which is part of bit_spin_lock(), is sufficient because the policy is not to allow any allocation/ free operation in hardirq context. Therefore nothing can interrupt the operation." This also includes SMP function calls (IPI). > */ > static inline bool __cmpxchg_double_slab(struct kmem_cache *s, struct sl= ab *slab, > void *freelist_old, unsigned long counters_old, Sebastian