From patchwork Wed Jun 9 11:38:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12309835 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 EEC3BC48BD1 for ; Wed, 9 Jun 2021 11:39:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9BA9B613B6 for ; Wed, 9 Jun 2021 11:39:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BA9B613B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25AA06B0072; Wed, 9 Jun 2021 07:39:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3A906B0070; Wed, 9 Jun 2021 07:39:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E3C56B007B; Wed, 9 Jun 2021 07:39:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0110.hostedemail.com [216.40.44.110]) by kanga.kvack.org (Postfix) with ESMTP id 576566B0073 for ; Wed, 9 Jun 2021 07:39:34 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F032D81F3 for ; Wed, 9 Jun 2021 11:39:33 +0000 (UTC) X-FDA: 78233990226.24.6B43BA8 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf14.hostedemail.com (Postfix) with ESMTP id 5C6CCC00CBF2 for ; Wed, 9 Jun 2021 11:39:29 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7C1571FD58; Wed, 9 Jun 2021 11:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238772; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JmSnpyHqca5PLmH1BHqymRQUyP4QdjzJkGjzwDILP8=; b=RJCMgcjXUe7ROekNc9knNZ3EovAV5bzgtjaRIZ52W6GxVogbwC36wO3UdMhVOohqu9CDr/ mT19g+aZtuBYkD29fLKOUzc9lca6x4UBRSpC3+Xu/MZreTJLiJdxpK4JQo2Di9H85ngtam FuCcTosNSujvBrbU0FWZwuXQyvjED6E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238772; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JmSnpyHqca5PLmH1BHqymRQUyP4QdjzJkGjzwDILP8=; b=bcbC7k8pol07TGi2Zq6kgTNF6P2X5P72t6Y5S5tDOI2PqAHl7iE1wo2HwFsauNM7dOdkpu cI0/YVvVKf6m+eDA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 4E48311A98; Wed, 9 Jun 2021 11:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238772; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JmSnpyHqca5PLmH1BHqymRQUyP4QdjzJkGjzwDILP8=; b=RJCMgcjXUe7ROekNc9knNZ3EovAV5bzgtjaRIZ52W6GxVogbwC36wO3UdMhVOohqu9CDr/ mT19g+aZtuBYkD29fLKOUzc9lca6x4UBRSpC3+Xu/MZreTJLiJdxpK4JQo2Di9H85ngtam FuCcTosNSujvBrbU0FWZwuXQyvjED6E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238772; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JmSnpyHqca5PLmH1BHqymRQUyP4QdjzJkGjzwDILP8=; b=bcbC7k8pol07TGi2Zq6kgTNF6P2X5P72t6Y5S5tDOI2PqAHl7iE1wo2HwFsauNM7dOdkpu cI0/YVvVKf6m+eDA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id uI2iEnSowGD6XgAALh3uQQ (envelope-from ); Wed, 09 Jun 2021 11:39:32 +0000 From: Vlastimil Babka To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Peter Zijlstra , Jann Horn , Vlastimil Babka Subject: [RFC v2 05/34] mm, slub: remove redundant unfreeze_partials() from put_cpu_partial() Date: Wed, 9 Jun 2021 13:38:34 +0200 Message-Id: <20210609113903.1421-6-vbabka@suse.cz> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609113903.1421-1-vbabka@suse.cz> References: <20210609113903.1421-1-vbabka@suse.cz> MIME-Version: 1.0 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=RJCMgcjX; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=bcbC7k8p; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=RJCMgcjX; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=bcbC7k8p; dmarc=none; spf=pass (imf14.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam02 X-Stat-Signature: 3qur91a9feudzkq8hga1ubyx5rcyw6hm X-Rspamd-Queue-Id: 5C6CCC00CBF2 X-HE-Tag: 1623238769-279955 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: Commit d6e0b7fa1186 ("slub: make dead caches discard free slabs immediately") introduced cpu partial flushing for kmemcg caches, based on setting the target cpu_partial to 0 and adding a flushing check in put_cpu_partial(). This code that sets cpu_partial to 0 was later moved by c9fc586403e7 ("slab: introduce __kmemcg_cache_deactivate()") and ultimately removed by 9855609bde03 ("mm: memcg/slab: use a single set of kmem_caches for all accounted allocations"). However the check and flush in put_cpu_partial() was never removed, although it's effectively a dead code. So this patch removes it. Note that d6e0b7fa1186 also added preempt_disable()/enable() to unfreeze_partials() which could be thus also considered unnecessary. But further patches will rely on it, so keep it. Signed-off-by: Vlastimil Babka --- mm/slub.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 2953f6e43cae..f740598696b4 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2420,13 +2420,6 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) } while (this_cpu_cmpxchg(s->cpu_slab->partial, oldpage, page) != oldpage); - if (unlikely(!slub_cpu_partial(s))) { - unsigned long flags; - - local_irq_save(flags); - unfreeze_partials(s, this_cpu_ptr(s->cpu_slab)); - local_irq_restore(flags); - } preempt_enable(); #endif /* CONFIG_SLUB_CPU_PARTIAL */ }