From patchwork Thu Oct 25 09:44:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10655657 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 3F399109C for ; Thu, 25 Oct 2018 09:45:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC422B2AC for ; Thu, 25 Oct 2018 09:45:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 214672B2B3; Thu, 25 Oct 2018 09:45:36 +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 B961D2B2A0 for ; Thu, 25 Oct 2018 09:45:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA3306B027B; Thu, 25 Oct 2018 05:45:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A29B66B027C; Thu, 25 Oct 2018 05:45:32 -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 8CC236B027D; Thu, 25 Oct 2018 05:45:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 47AB16B027B for ; Thu, 25 Oct 2018 05:45:32 -0400 (EDT) Received: by mail-pf1-f199.google.com with SMTP id 87-v6so6029517pfq.8 for ; Thu, 25 Oct 2018 02:45:32 -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=2667EAPFGGqTW5KmFlUaFOrwPJrjirsBYthOK8nJl3Q=; b=dGPv6jTOENPi/qz7xO3GRWL02EvDBMObTPJ4YgrtAE36Oj0YYvaJqELN71hK4ytMhq PYYfMv7BMSH0bfwEAZ2PpdM3xIxK/vFYLcsM3A5yROigOFxGqFiUV5NX9uQgoY/WANq3 4xwmR/7M9HU5tKYpvxXwRGniOpykKFgBm8NGx8eqxh/eVBPoQtGNwiHkDVtM2PHKtag4 tmyKo9thahcyfo+drfN8ZtvKfICv/tKV+C+FUXKMqpYoajKgXSHqYhGQLpumqyObm/ov 3CifOE3cBwE10xz+QcWKqvyqYgWczpWzsTLu3PUpkseZlyjDdY675O0cgP84e6uBCbFU pnCA== X-Gm-Message-State: AGRZ1gJ3Bn4F+sTRok/XfcKrXwvB0lrTy6p3znqNPLkFfrJ0jblcJDHm zlan+QVGd4N6Pp1jeeW70+40VfBgxT8g+1xwv7bTPG8YL0uaQY0XItu6ZeUl85TEJSQFcZuPvFF aO3/0L5ZYRiH8UtBRlNdCTCod6fw8ZnWEy3tmwbRXD23wNXaiptlPPsSOUPKGWg6QCrcFKj44oq qodWzZ9jm5Mkxcw+MiQFWyC8JQWcWVwcmSMQ5QGZq/bULXOCqlCLUUWJ1SwajXAQz5IGE6Q8Bnr /wcVecOe2z5snm+8Z8kaE0Rui1YL3ts0wCUYdgB/L4qSRn0V2qcg//8m9wZY0VPaPAmbuuvz/41 7parLF+XpUrKZ/BibUsS5lv+LMw45eF1SmFL9CckTvIVpKfpvCVzMpL5eGfzHZ8iDgtaVjh4AxD I X-Received: by 2002:a17:902:5982:: with SMTP id p2-v6mr808979pli.241.1540460731977; Thu, 25 Oct 2018 02:45:31 -0700 (PDT) X-Received: by 2002:a17:902:5982:: with SMTP id p2-v6mr808948pli.241.1540460731050; Thu, 25 Oct 2018 02:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540460731; cv=none; d=google.com; s=arc-20160816; b=sgx8NdwbX4eJL12VaNM3IT2glE7ns8V3h9jYpGpvjJ1GoT6BwQqmTor3PGsiEnZW+X Et3A9oys/gehodJKrqf2BxiL14nVrcksja580wEeoOfdMINa2M/qH74U6nAHiX+DIPmf MVh6YOpLyX3rVY96nlU3f8Tz/66qpZ1weFHXFr7EHEe6kZkXxFzbswBWXHPeE27htL0W az3mJUSWprlWCMH1+rnXT10kCc1bJ5WRqABp+ulQONSaW8SuDBXXzN/JRiH0+91WiMUB 7G+sebQ4LecKiamYLXn9b9yjgNMZP7kQUM6/Xxe7g37zkXxkA9eLVWwKfnjdSsw9TWvv 3nuw== 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=2667EAPFGGqTW5KmFlUaFOrwPJrjirsBYthOK8nJl3Q=; b=zeHKC8Wu3rmyRdXwDLjhtcr9WDtFACMoY9Z9MptpYhVKpltsfezXijUE1YdFq1EmTB TSbSfi8i2/OMspVy66RKrYOqkjXKF0OJJYNWi2zVUU/EgD8+s87LrReXCKLLsXlz2chO rlhLlHdCQlHtxq1vKT7Om141O7y4xfEfEvbitc+VvL8oNr8zvzdHxYMaATORxl84LyeG EEdMd2DNBVlNdcarzfNmncVNam57fC+ZwMbEzKVBPo0dvxpek9u7QgpkNay5/6NgJOiE s8etFsMt71Y+wAg0gGgo5lYt0Rmhmljb6nxxBx5JKgMXWje4qvwsAk7aS84Spd1MYTan z8Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=u6ddFhkn; 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 z31-v6sor2926595plb.35.2018.10.25.02.45.30 for (Google Transport Security); Thu, 25 Oct 2018 02:45:31 -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=u6ddFhkn; 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=2667EAPFGGqTW5KmFlUaFOrwPJrjirsBYthOK8nJl3Q=; b=u6ddFhknEbr6O26sDoUcDaaLMfeq3OaPL/an0a25WLT6Gc3lxgxFjgSKWXdJaS7IWB Cqx3fAuqsytnUTDPdzC0ijpDkJkqdGUPv+2Sx4jCGCAez17x0mvrJlhIYnnGOsyt0u1T SJ5Y19A3MN08bimV4DA/WqBgkzk+KhPWxDVCXIBrcagcv6CVbfOeFuXWA1tKHzCkqdxl xvnXGlV/bSRlpREH3Cqo5f/kEmGMDNdyJ8fkXlsegayqVMZ8mjHNrqmu+K1sE+ZFye/n 1M3LCy33iDBTAX2nZc/eVCWT0MdqOexLIfXRnHJ9n0LJ45mL6GSdAEUtMjvStlG+hm1Y 7ZLg== X-Google-Smtp-Source: AJdET5eJpFzOQ38HVB6XiievhXQaU6kAI/iIYbM4hngRNIaBrJQYXPh/ybpQtnTOu092YKjMbwUKWA== X-Received: by 2002:a17:902:6b04:: with SMTP id o4-v6mr809449plk.333.1540460730407; Thu, 25 Oct 2018 02:45:30 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id u190-v6sm28858049pgu.3.2018.10.25.02.45.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 02:45:29 -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 1/3] mm, slub: not retrieve cpu_slub again in new_slab_objects() Date: Thu, 25 Oct 2018 17:44:35 +0800 Message-Id: <20181025094437.18951-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: X-Virus-Scanned: ClamAV using ClamSMTP In current code, the following context always meets: local_irq_save/disable() ___slab_alloc() new_slab_objects() local_irq_restore/enable() This context ensures cpu will continue running until it finish this job before yield its control, which means the cpu_slab retrieved in new_slab_objects() is the same as passed in. Signed-off-by: Wei Yang --- mm/slub.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index ce2b9e5cea77..11e49d95e0ac 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2402,10 +2402,9 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid) } static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags, - int node, struct kmem_cache_cpu **pc) + int node, struct kmem_cache_cpu *c) { void *freelist; - struct kmem_cache_cpu *c = *pc; struct page *page; WARN_ON_ONCE(s->ctor && (flags & __GFP_ZERO)); @@ -2417,7 +2416,6 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags, page = new_slab(s, flags, node); if (page) { - c = raw_cpu_ptr(s->cpu_slab); if (c->page) flush_slab(s, c); @@ -2430,7 +2428,6 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags, stat(s, ALLOC_SLAB); c->page = page; - *pc = c; } else freelist = NULL; @@ -2567,7 +2564,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, goto redo; } - freelist = new_slab_objects(s, gfpflags, node, &c); + freelist = new_slab_objects(s, gfpflags, node, c); if (unlikely(!freelist)) { slab_out_of_memory(s, gfpflags, node); 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))); From patchwork Thu Oct 25 09:44:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10655661 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 3442113B5 for ; Thu, 25 Oct 2018 09:45:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22A642B1DB for ; Thu, 25 Oct 2018 09:45:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16B3B2B2A3; Thu, 25 Oct 2018 09:45:48 +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 A7F642B1DB for ; Thu, 25 Oct 2018 09:45:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A8DA6B027D; Thu, 25 Oct 2018 05:45:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 82DD46B027E; Thu, 25 Oct 2018 05:45:46 -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 6D59C6B027F; Thu, 25 Oct 2018 05:45:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id 2A7C86B027D for ; Thu, 25 Oct 2018 05:45:46 -0400 (EDT) Received: by mail-pl1-f197.google.com with SMTP id k12-v6so4809418plt.0 for ; Thu, 25 Oct 2018 02:45:46 -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=KKqarB6+TclYvRz6jTRg9yZmlYdYhBY/UUEFryGvU3A=; b=BMT4gl3qW+bILhT/9wjaa4H4OwjimaQzlkiOUp0G5GlL7GDa5K5bs7JWpJkLW5Hbzl DWEnDyCUMuToZok9LXl+tz/B/xx+jt6N6k/EOsKubw9CPTaKJXD7XWL6Zi6I+6k03KJF 9x/GjZPihiLNLOu6fZ7jJ8OsepiPUyTm3nNX5bOL/uq2vl7S/7k245xvAX1v3H8qmPA6 AOmsQ9hofWwmEqAXIOrzm+wqlgCoxa4/XhyjiAo6cxx5tPyu/nkqK7nZeKfhjnTSy4ZH v9YGxqcw3ulCTJaglNrA56Sv5IXdNECgle7kIv+sjc9zCOP4xt/466OcWTeyKOffuyGK HZog== X-Gm-Message-State: AGRZ1gI7Up7wcybE2BjBT0sWokLypmf7daJ4tgpA8010utT+STpZqjNs 4k5kNSZUo67DjhbHDeg6Ruf40iG/JWbxwozHedkXAAFDoRMfSAl6nCufl7Ps8DyfqEZpONQqbv5 GVEBWPe4vzYWD9tRL9j+rVxG4b+wb+2Kq7SiWSrmMbHHqbwDQDiWkIrjB6yk7w2Iwy/HT+8En9/ sLbG5jk/kfvejgcjh+EHji5HfFe0POyFvJplrnqEAZRGOHXfatmsNPi7yBDyQB/fVyXghg57Zgg NdJ2vlssgIantlBMAtAH+lI5W+a7qJrwFBlcOqDk0traHcAjhdeyUyAVX7JtqPZDID2AQpsAIwK oeBK8Q9ueqSpSSgo4bhZCcObcsW0Bx1OAn92fBT/iesL0WMWukZIiakvVFaDvroLd71S6o0qaYh A X-Received: by 2002:a17:902:9a9:: with SMTP id 38-v6mr808384pln.319.1540460745824; Thu, 25 Oct 2018 02:45:45 -0700 (PDT) X-Received: by 2002:a17:902:9a9:: with SMTP id 38-v6mr808357pln.319.1540460745100; Thu, 25 Oct 2018 02:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540460745; cv=none; d=google.com; s=arc-20160816; b=ykd1VZ3fjISkjpxSzxccEPIeOoQ5t/qIIuj8O6OCl8ORTupUxuq+RHaDRqq5AZzBEn PX6Pid0wdxWJuI9NX10k+o7hRVeZMAPZ61stEHRoNHRXLNys8fUybT/7/2Wwc7yQ+jAo TVIspXKA4JMjWslBMNyjdAIuS2FirbXYPiWy4w/285wzANAAn7387XvhwOy9vKRc0WYv zVZRoFEUuW/ORNANAZDlplLs/PsytJr05VJj/lqaP0aba1ZR39von+wJ3T83yujgMFgi bZZXTGHdx/b7hILeR3X3PNumgZSKX8sP0/k1VOkATTiF0bPDKlvt+kqrxDn/2AkXxEFO fIRA== 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=KKqarB6+TclYvRz6jTRg9yZmlYdYhBY/UUEFryGvU3A=; b=IUZ1XT9bty/VnyyQRqAqkKyeaXpL9UrT5kmaBV3BNXlF9+U7FF2UZ9O7dgapHOH7g0 dr2FkpCz4LFREva4R5Q6h/E217tyf42cCn2SQ0A9Sq/DDkV0IKC2EZX3Kvd5A6s27fwh RtBBAZF6HUfDIYY7XCsTgZ0UHLP+PmcQpwkg/+kPryrJLrZp1QH5u6gwDtlW9rhqFD6C QEGr5AFp3H1pXOFAacv/akU0OORfQxJYIcUv93UjodDDUc9/rThNS0vmUTyuUgdriwcH Rh5ogItGwRfXj/P5qYbLp5c6SU3kr5OoL6MT15C8Ldk4BaWj+4qmm3JDvaT8gvfCpBXH cJoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uZ+LuSDo; 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 x8-v6sor7022647pgp.61.2018.10.25.02.45.44 for (Google Transport Security); Thu, 25 Oct 2018 02:45:45 -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=uZ+LuSDo; 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=KKqarB6+TclYvRz6jTRg9yZmlYdYhBY/UUEFryGvU3A=; b=uZ+LuSDo2zG9o1yS6X7T8nwAMZQJo7Z+peOF89yAaUo0s7d1B0Zy51++owj4SVIQGX 9y9ITRvn3Y5JmsJAyj2R/8rvwc8Z1TTJNXZ9owTDFsihac+mRVTBnJPspeIaLi/VOVZY Zz/UOwj/Siyn2YZ8+vkCDIIcCfd48acsQM6+m1098QUSWgF8I1eoH6XtukMnA05nkP2W FrFJqyBCJsepALTEbxU6Yx7BBRgeyu1Z2hPc3+CpXO9UJtaN5uE9pmNoyk9Cnk+sMcPY GCJncXtV6AQTCPM2r5U7RTLArsvHYTf7vcYPX4uBi9DAYr4chu6/qntJGgm+NWDM6+GJ kAsg== X-Google-Smtp-Source: AJdET5du1bpDmY8VGfq02JoD8qQswtSTTIpM44d3H34UDd5KyucFjCEPgF9u/b/6TwKJNFzjGmfKNw== X-Received: by 2002:a63:3747:: with SMTP id g7-v6mr810424pgn.59.1540460744672; Thu, 25 Oct 2018 02:45:44 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id u190-v6sm28861157pgu.3.2018.10.25.02.45.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 02:45:44 -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 3/3] mm, slub: make the comment of put_cpu_partial() complete Date: Thu, 25 Oct 2018 17:44:37 +0800 Message-Id: <20181025094437.18951-3-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 There are two cases when put_cpu_partial() is invoked. * __slab_free * get_partial_node This patch just makes it cover these two cases and fix one typo in slub_def.h. Signed-off-by: Wei Yang Acked-by: Christoph Lameter --- include/linux/slub_def.h | 2 +- mm/slub.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 3a1a1dbc6f49..201a635be846 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -81,7 +81,7 @@ struct kmem_cache_order_objects { */ struct kmem_cache { struct kmem_cache_cpu __percpu *cpu_slab; - /* Used for retriving partial slabs etc */ + /* Used for retrieving partial slabs etc */ slab_flags_t flags; unsigned long min_partial; unsigned int size; /* The size of an object including meta data */ diff --git a/mm/slub.c b/mm/slub.c index 715372a786e3..3db6ce58e92e 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2201,8 +2201,8 @@ static void unfreeze_partials(struct kmem_cache *s, } /* - * Put a page that was just frozen (in __slab_free) into a partial page - * slot if available. + * Put a page that was just frozen (in __slab_free|get_partial_node) into a + * partial page slot if available. * * If we did not find a slot then simply move all the partials to the * per node partial list.