From patchwork Sun Jun 6 04:17:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12301791 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 C4A6DC47096 for ; Sun, 6 Jun 2021 04:20:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 482D361420 for ; Sun, 6 Jun 2021 04:20:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 482D361420 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 68F506B006C; Sun, 6 Jun 2021 00:20:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6662C6B006E; Sun, 6 Jun 2021 00:20:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52F9E6B0070; Sun, 6 Jun 2021 00:20:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id 226F56B006C for ; Sun, 6 Jun 2021 00:20:46 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A7D5F180AD806 for ; Sun, 6 Jun 2021 04:20:45 +0000 (UTC) X-FDA: 78221998050.28.B984377 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by imf12.hostedemail.com (Postfix) with ESMTP id 9D5D813A for ; Sun, 6 Jun 2021 04:20:42 +0000 (UTC) Received: by mail-pg1-f170.google.com with SMTP id j12so11195315pgh.7 for ; Sat, 05 Jun 2021 21:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=E4PDzC/R73bE9jPmJKcYh4JETGcn02NCjNur7gAoAsk=; b=fB4EWvy1rcDvM7ghU3WRKdvbePGOPcvHIjMaCEtn1Zu+WkeXvm8PXy2FyruDsQvyM3 ngxu/2Pc+Ql2SCvK4f3UPtOJKV1AjNAF3hI/r+EEQIWA8hXGtBCCTCKJCQCCeq3KwZJ3 479Mp2I+1RFX38NkSGi8k1ir8ZHaChbkvSxlNClGelMdhlIroGg7SCafvUmDExWTgML8 /tvegABjp+XvYkU4P0Zqprn45CvgHzO5rc+mxQ2R66V5J7afGwlpQOcuEC0AwWPZjwX/ ppGKc/bczHseBCsT/7ZD8jO5JkQ7Wu+Pc+fqz4WhC4zvw/0YE06KJXTnI8zgO8Bo9Za4 Z+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=E4PDzC/R73bE9jPmJKcYh4JETGcn02NCjNur7gAoAsk=; b=EQwfDJ5xv6KyyVoWwOjvJ2Vzn62VlNbuzTjzQu5rGNsXnH/8xhOOrotoGo7KS2Yrxy Y+idRi/uyxrrhMfH+CztnS4bi+6O+e5C4Kx3HMAe3J2jP4DI1sdKGrgz7Tw2yqgW5ncU /NW6JZuaF5Q7H9y1XnX0QCq8dG+0iVS1Jz9cJlO1fmI11BxLD/NABuznOuiefbybeZh+ VN7ZHEGH0xbAmRpjyjZ5H3D+yu4I6u7pe0qs+O/210bBB3wdeM6mYUf5LkII/f53tTFa ZXTGAXx6ef6/J9qHCndK+jpSJHecDN5nWAjXVQ838nuh75tPKZSk4D6594unC5TGmSkH vYgA== X-Gm-Message-State: AOAM530/tQzJ4skoy9sKKV2x2qVMb95ap5i4ujhBFCEFUp0ypDLw1viC PDNhOovmRkP9OrOSaLbI+XmLtA== X-Google-Smtp-Source: ABdhPJzEVgIYny9BhJRituSgtwy850EhnqB+7PDC4mlCuzvNz8weefC/oB/79N77nRKsFuC3d4Blsw== X-Received: by 2002:a63:b30a:: with SMTP id i10mr12176783pgf.306.1622953243374; Sat, 05 Jun 2021 21:20:43 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.249]) by smtp.gmail.com with ESMTPSA id y4sm4817527pfg.112.2021.06.05.21.20.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Jun 2021 21:20:43 -0700 (PDT) From: Muchun Song To: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: [PATCH] mm: slub: replace local_irq_save with local_irq_disable Date: Sun, 6 Jun 2021 12:17:50 +0800 Message-Id: <20210606041750.69403-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9D5D813A Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=fB4EWvy1; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf12.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.170 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: 86ct1gc66ca1j4ny3r95a5kc4kya8m5w X-HE-Tag: 1622953242-277833 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: The caller of slub_cpu_dead cannot be irq disabled (because slab_mutex is holding during the processing), there is no need to use irq_save. Just use irq_disable directly. Signed-off-by: Muchun Song --- mm/slub.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index ee51857d8e9b..fbf592ef14ff 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2529,13 +2529,12 @@ static void flush_all(struct kmem_cache *s) static int slub_cpu_dead(unsigned int cpu) { struct kmem_cache *s; - unsigned long flags; mutex_lock(&slab_mutex); list_for_each_entry(s, &slab_caches, list) { - local_irq_save(flags); + local_irq_disable(); __flush_cpu_slab(s, cpu); - local_irq_restore(flags); + local_irq_enable(); } mutex_unlock(&slab_mutex); return 0;