From patchwork Thu Oct 25 09:44:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10655659 Return-Path: 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 1C141109C for ; Thu, 25 Oct 2018 09:45:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A5222B1DB for ; Thu, 25 Oct 2018 09:45:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F20262B2A3; Thu, 25 Oct 2018 09:45:40 +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 8DBAC2B1DB for ; Thu, 25 Oct 2018 09:45:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BE8F6B027C; Thu, 25 Oct 2018 05:45:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 743DC6B027D; Thu, 25 Oct 2018 05:45:39 -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 5E67D6B027E; Thu, 25 Oct 2018 05:45:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id 1D87E6B027C for ; Thu, 25 Oct 2018 05:45:39 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id f22-v6so2027188pgv.21 for ; Thu, 25 Oct 2018 02:45:39 -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:in-reply-to:references; bh=8UTvS0pCfRKjH/rnpXhrSxP7B/s/g+tzhkGKQxWsplg=; b=V313motEhmuD3JASMYHjCfQ7R464CUsui5NET1JYX6oGRBYdL88ReYsreX4+g+pHrq 8S+05Yo2kdvswBhTL+4XkbRSpS2wk/TnkMoWuM/HKqTVyPtoGwytSfV0HQrF6onBISCW veOLLvlhRVRO5rwqul55/ehTNAB3ienZjKPERSV7ThFiJwGExPWdkVmMWYoaMttditra mRa+/WdkQ/sTJJ1LuNQJvbnjqsk1qMnCPeeBxH7X9INQ8HxtsfZvcYnnc/3ixQLbI6ZC +BgAmSHO0emV5I65bCi2XV25XbocQFb8LsuREresbpJVMhe7ixV7HO8bkVAhTLEkmSnj ELJQ== X-Gm-Message-State: AGRZ1gIiJo1eXD6W9FCJWvHWausl9GxKOx0We4z0anp6C99VsK3H1YjP DbZYMS5j9ywiplIEf4XBaYGT9SI4CIZT6iD+onF1SskFIPpUcl2LgoCdrSf4hch5HvmmFRX+DuP VolIuGIj7zygYRqLbZcmlwPnKERWI6+3VIb7Uq3Zi1rEv0itYsNVniiAFxF35xG6l2BqSJuwV3x sJip/Uzto0evEzXLArjrss7/XZn6NwtzE/XKaAiSQUv3V1vtt7rfht3yo9bt0zQlW1E9VzVysEn iFuT/sRXn+ZFcnjLHS4RKIclOhv46KjGHXAkzM7woYYkHSJjszt1Ec1JcfvdTde9p7AvBmZ99IC 4Oio82L4k1SB2Q18ZbDRJpleBCvGWg31hMc5U44ubwGf/RRdyDQvMpWUgQEQfFYTkwH9HT6Jv87 T X-Received: by 2002:a63:4723:: with SMTP id u35-v6mr752484pga.95.1540460738800; Thu, 25 Oct 2018 02:45:38 -0700 (PDT) X-Received: by 2002:a63:4723:: with SMTP id u35-v6mr752461pga.95.1540460738175; Thu, 25 Oct 2018 02:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540460738; cv=none; d=google.com; s=arc-20160816; b=KgOZR/hdNUUHdv1Yr8emns0oVSDURsVkNuHs5fhcGOmHlFqDYIuxe+nOE19/LY52uB NJEvXA706OH3/+FC4RCn9aAJdOfH1+ZosMf79zFsfW5k0YEiPFTeRaWFflJP/ABN4LLu Wrtlr7XmjwRsmGFa8YsFbMimsX4tMNaDRtDUYXX9XaD4ITZKJ3iVNUJI75HQMVjOW8SA FWYOML8HEL8jh1HImV7b9CqGqX+2BYJvIs8fbAHqmEZzK3oZtNvgeYTxSUR57tyaSLXB v4GjvDUWgiaQz/uC67wxaBGjPh4svvbJDHQsGoQNJ+duzhcM/zJRiKm9YSeaEH2h4Uj1 nl6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8UTvS0pCfRKjH/rnpXhrSxP7B/s/g+tzhkGKQxWsplg=; b=PWLIDU7S5+wCszQvebQnCzjt+d8ydxYeVIBYaNdPF8FRS2K5qnc9ou2kNbdw/H9zS1 +bqtVJ8aTMpJ9Rt/Xk/qQFoOh0HCQKJvm0YEdM4VJZWmKG5ZR7JqwIPch+/gKOIruu43 YmemoYQVhWVXM/5tZCONIOxj98xhL4xMwaM2O56R2e/HUbxUdocTowaKwNjkcgyfZZYN F3y3tPiaYiGgE+MBfIx0HKf86gKKr2R2P1o2SvIKsSkeSZdgnuddsVkPtX4ZtRchqDUh Ocz7ImcSUq8Tov/MQXGJ92MVhfSS/q6v6Pdii3GscAtSKG9kUsa1aClxsmADly2AAHkN yuNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rj5qXEOi; 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 t5-v6sor7260515pfk.58.2018.10.25.02.45.37 for (Google Transport Security); Thu, 25 Oct 2018 02:45:38 -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=rj5qXEOi; 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:in-reply-to:references; bh=8UTvS0pCfRKjH/rnpXhrSxP7B/s/g+tzhkGKQxWsplg=; b=rj5qXEOiKv353BABJRMDf6yx/8IdgLHCsJQbwMSz7/5U+GcHUFkH4/sPBVfCorvROY X3zauu/Wzpf33rZhUfvrKEqo3I14kGg6Vx0tw5F9byreSdvVvzqHj0FH64lbSh5YglG2 u5DBI+/n+Tn8KjPMYNBbwlt6O65F4hlkWpXUJyfime8y69P7ZD2aLH/mQ7WxdJSZwjnb 6ijNcL+8k/j6lPNCCj5KDtGhb/eRyH2N6+tkWSgql5Wu93W0mvrR/MZYdiEz3GO6lG6S ZHHyxrYhQpHqvt2i4IjnSMj3Fo4M8RL7CHXFKffmKdSwP1+d8+756poSmPA8+orT2e3u fo8A== X-Google-Smtp-Source: AJdET5cCKUerG+Kogk+JxYsyA1svRyv14cZc47UuMlqHyrdKh+57XWq4HYNcFE3VDFTl0lNNpFONAw== X-Received: by 2002:aa7:814f:: with SMTP id d15-v6mr855092pfn.78.1540460737502; Thu, 25 Oct 2018 02:45:37 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id y85-v6sm10153676pfa.120.2018.10.25.02.45.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 02:45:37 -0700 (PDT) From: Wei Yang To: cl@linux.com, penberg@kernel.org, rientjes@google.com Cc: akpm@linux-foundation.org, linux-mm@kvack.org, Wei Yang Subject: [PATCH 2/3] mm, slub: unify access to s->cpu_slab by replacing raw_cpu_ptr() with this_cpu_ptr() Date: Thu, 25 Oct 2018 17:44:36 +0800 Message-Id: <20181025094437.18951-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20181025094437.18951-1-richard.weiyang@gmail.com> References: <20181025094437.18951-1-richard.weiyang@gmail.com> 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: X-Virus-Scanned: ClamAV using ClamSMTP In current code, we use two forms to access s->cpu_slab * raw_cpu_ptr() * this_cpu_ptr() This patch unify the access by replacing raw_cpu_ptr() with this_cpu_ptr(). Signed-off-by: Wei Yang --- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 11e49d95e0ac..715372a786e3 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2643,7 +2643,7 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s, */ do { tid = this_cpu_read(s->cpu_slab->tid); - c = raw_cpu_ptr(s->cpu_slab); + c = this_cpu_ptr(s->cpu_slab); } while (IS_ENABLED(CONFIG_PREEMPT) && unlikely(tid != READ_ONCE(c->tid))); @@ -2916,7 +2916,7 @@ static __always_inline void do_slab_free(struct kmem_cache *s, */ do { tid = this_cpu_read(s->cpu_slab->tid); - c = raw_cpu_ptr(s->cpu_slab); + c = this_cpu_ptr(s->cpu_slab); } while (IS_ENABLED(CONFIG_PREEMPT) && unlikely(tid != READ_ONCE(c->tid)));