Message ID | 20181103141218.22844-1-richard.weiyang@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43E6C17DB for <patchwork-linux-mm@patchwork.kernel.org>; Sat, 3 Nov 2018 14:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2268C29F58 for <patchwork-linux-mm@patchwork.kernel.org>; Sat, 3 Nov 2018 14:13:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14C0D29FF5; Sat, 3 Nov 2018 14:13:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB73E29F58 for <patchwork-linux-mm@patchwork.kernel.org>; Sat, 3 Nov 2018 14:13:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E999B6B0003; Sat, 3 Nov 2018 10:13:02 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E47E36B0005; Sat, 3 Nov 2018 10:13:02 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D36CA6B0006; Sat, 3 Nov 2018 10:13:02 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by kanga.kvack.org (Postfix) with ESMTP id 9339F6B0003 for <linux-mm@kvack.org>; Sat, 3 Nov 2018 10:13:02 -0400 (EDT) Received: by mail-pf1-f200.google.com with SMTP id 87-v6so4291733pfq.8 for <linux-mm@kvack.org>; Sat, 03 Nov 2018 07:13:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=Irbf9CeYSnX0fa1gM/VSSJKiuFmX3Y1gPa+F00ktFbc=; b=KuxRuXnbYHm4G+wh2DztgED/OKgbU9X8OWYH2RiwKtPMBU0QYhQ5ubnNNMJoblruX3 5zLL4ug1Q+4Ylk+dNmEgXcazrpGnsRV7ci3PW6VmXMc0fL04tKmBcTUhpW5BM0yjjOXm +ROcMAWh58jcTmgTrQyaY5dARKsJ8+SNwy/1bG2ETv6JqtKjSGGQmygLXIPR4AGEiMby iWUq/2kBDUCrpHeA0fkYR82t829Dzfc04eHu/6Kz7dfVUsKyQwF0sKZzfGCWWGb18ENt t6UhVWy2HFz9PY0kEYqsVJk+qsnorK2+ktKf951mJUCSbC5yG8sTih6ahs5EBjXcu4ab KiFA== X-Gm-Message-State: AGRZ1gIgJoJ4ywPZKvEnc5T63nPNb3QrfnvdHDiRUEvJOhD3khWdtjOH Hn1EnN5w0wD3cKQOvKpYzs/Dp+5bKG0Xd7pU7F1O+kKehsUWacrKADMuAajiBGZyr7fnKctSzaZ 78YhzspDvbCz28ZZlaooHeH+T3tiHGn0USgcex9592YYRONncAg5WUmnqbAI8WrfmRm7WceW2m0 WgXkh9haET1ZzNWCiEidvwCDpltuO/e4zAvuI0cGjIw1p1rT9O5T3FCDtXlHY45C6BV3vCXHnep Z+tbc+u9UgpnsBWYXNz813NEDruA+WDuY5f6cl/3JdCM38khrqOQec9Cq9KY+XysCxNX4jKQ8NR d1lNDZKb5DanIk1TXmYEwTlpRLGHv9lH1PtOKnBiXTvP83RbLymaQnnAx062HnihrBWElvQ9Ns2 T X-Received: by 2002:a63:e445:: with SMTP id i5mr11611703pgk.307.1541254382261; Sat, 03 Nov 2018 07:13:02 -0700 (PDT) X-Received: by 2002:a63:e445:: with SMTP id i5mr11611671pgk.307.1541254381495; Sat, 03 Nov 2018 07:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541254381; cv=none; d=google.com; s=arc-20160816; b=ZHKj1m3ZDU2/+GDRZbdw+SByou1YDUDjyp0oPjEJoY/1z0In7okxtX2I2K29VLTLp0 rcMnuxGRDHRi/IOix4pffDpwfZ0M3Q2pFqrdrvIdDtHZu92/X+13elv8ofjxUsjo6nGd jmnOhD46b8veBMd+GeKd9/+kbmdmg2oenwwn+H81VCeQKA+aql0f550bE7Xgxmq4SlT4 bMDKtBo2bG3MrVju2n38t+2UhEO3sgsQsNJWji1Zc4vBthl/gpmYgHRhFumYxwPCUYH9 sSUDYyoQpOhF5zW7zP83d9PfjvRVD5hxe6K3hs2U1HKuDOpzOz+WArvVzYwHM1l4mOpl ghEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=Irbf9CeYSnX0fa1gM/VSSJKiuFmX3Y1gPa+F00ktFbc=; b=X30dB+y35auiibUpZSkm/1HoO3AU6ngI3tUKbVHOCN119Y9rgLTb7xtb8zoEx7MNNY 2OZBB6qUMDFCHgRXh7LzEB/WJrbX72uIIgjm6ajXa9SMULIGWYDUgxQkPHiS3lAZSaDR w3EJJ5v47TS8l1ORSAfCwRzuK2bWcRn5LjQfNUPnK7xE4tsW8QxbRrTvUMUKYkdeIkUE iJxbeqv2OKZYJPMITJGlvOjC7MNZ27ic/IZ/VA8u3rmZ++KO3se+0VKFzSVGsh03OG1W HvVDO1Z0sBZUaJF7/N4o06Xnu8oa//rGxLER4gvgOnPj/+BB/cYTjmuUNIyLx1ZxdoXy brFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LcXOkp3k; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g31-v6sor7109537pgg.8.2018.11.03.07.13.01 for <linux-mm@kvack.org> (Google Transport Security); Sat, 03 Nov 2018 07:13:01 -0700 (PDT) Received-SPF: pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LcXOkp3k; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Irbf9CeYSnX0fa1gM/VSSJKiuFmX3Y1gPa+F00ktFbc=; b=LcXOkp3kHAJjBx8kOap/cP4H5BKk5TrdBnxzYZ8sHYSDrL07a0JBLwZ+YEsQTjpNog lr5zYC++3i7eD+GBUKdmC/u30i5aTMFPhx1jQWBHF9hXr/8CygXnVo+JQuQKNmPTPWJK gQdUqkbz1Ay69tOZJ7ah6z2qRpgRVhotatqfdzaDoveDyfnCa6LF5PxTIoXiwXWTMiwo HonH9AsX3pHXnRU+CesjYO/z/nzSF8+QeGTCeK7+nY6iJJfpcdSSlTy/kazBy8lR2u6B uiVUPx+6vYnpjCKrpJjZt49wzdl0uDCBNJuAJEXHY71FKMTRbl/ufUpKlgGurBgJ8Yyl HRxw== X-Google-Smtp-Source: AJdET5eG+n4wt4404bso/dcFvYM9+xjl4hrNr/FxXmYhbgEKyh7cBa6Pg9Hs6WlzbzbmCNZdE4nERQ== X-Received: by 2002:a65:40c5:: with SMTP id u5mr13994869pgp.46.1541254380841; Sat, 03 Nov 2018 07:13:00 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 123sm13305142pgd.75.2018.11.03.07.12.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 07:12:59 -0700 (PDT) From: Wei Yang <richard.weiyang@gmail.com> To: cl@linux.com, penberg@kernel.org Cc: akpm@linux-foundation.org, linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com> Subject: [PATCH] mm/slub: remove validation on cpu_slab in __flush_cpu_slab() Date: Sat, 3 Nov 2018 22:12:18 +0800 Message-Id: <20181103141218.22844-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.15.1 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: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
mm/slub: remove validation on cpu_slab in __flush_cpu_slab()
|
expand
|
diff --git a/mm/slub.c b/mm/slub.c index 1b6c20ac2a08..eb93d767e87d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2291,12 +2291,10 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu) { struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); - if (likely(c)) { - if (c->page) - flush_slab(s, c); + if (c->page) + flush_slab(s, c); - unfreeze_partials(s, c); - } + unfreeze_partials(s, c); } static void flush_cpu_slab(void *d)
cpu_slab is a per cpu variable which is allocated in all or none. If a cpu_slab failed to be allocated, the slub is not usable. We could use cpu_slab without validation in __flush_cpu_slab(). Signed-off-by: Wei Yang <richard.weiyang@gmail.com> --- mm/slub.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)