From patchwork Mon Feb 17 15:04:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 11386615 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7859D159A for ; Mon, 17 Feb 2020 15:08:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4484A222D9 for ; Mon, 17 Feb 2020 15:08:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="evIT/ldd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4484A222D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5D79F6B0005; Mon, 17 Feb 2020 10:08:09 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 588976B0006; Mon, 17 Feb 2020 10:08:09 -0500 (EST) 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 476196B0007; Mon, 17 Feb 2020 10:08:09 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 2E2B56B0005 for ; Mon, 17 Feb 2020 10:08:09 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ACA6F2C0D for ; Mon, 17 Feb 2020 15:08:08 +0000 (UTC) X-FDA: 76499949456.03.nest31_8336418a4f21a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 729202B87C for ; Mon, 17 Feb 2020 15:05:02 +0000 (UTC) X-Spam-Summary: 2,0,0,f8dca032e4226849,d41d8cd98f00b204,qiwuchen55@gmail.com,:cl@linux.com:penberg@kernel.org:rientjes@google.com:iamjoonsoo.kim@lge.com:akpm@linux-foundation.org::chenqiwu@xiaomi.com,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1345:1437:1534:1540:1711:1730:1747:1777:1792:2196:2199:2393:2538:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:4384:4385:4395:5007:6261:6653:7576:9413:10004:11026:11658:11914:12048:12296:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13311:13357:14096:14181:14384:14394:14721:21080:21444:21451:21627:21666:30012:30054,0,RBL:209.85.214.193:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: nest31_8336418a4f21a X-Filterd-Recvd-Size: 3489 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Feb 2020 15:05:01 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id t14so6835213plr.8 for ; Mon, 17 Feb 2020 07:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=guNyIr+Mivzu5f6WQToJsf1lfI3evqX+syaECjDoxNU=; b=evIT/lddhYQhEhfdovXooTMq8VH6ZBpM8ExZ5GfvEkDs0PuRNwCSn8kHF8LtJtDHi1 ifbrdWzi0mbjPTnRT4ngafoLRIR4CG5F67NPGl4xnVtQkQnatBDA62g1oh4L610beuJy TtA7JN3ZM0VjuftkAcQaIjyBg1VKWsRjYjKifYFfCIrc5DDEDpKI8UlCWN4zteWa05fp FTQ2z7eHfTle3phHS+rt4vO7+KZJAA99/59eOvMzcrWLJJS5JhktnEYk7YRqwcyLFYip 0Cxzs4wl01yM/zj2SjhFwEpLMIZf+WkRNAqHFGAzFrm6vFjkJFI9VlQxo6LLCTjT1qvv 6dFg== 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; bh=guNyIr+Mivzu5f6WQToJsf1lfI3evqX+syaECjDoxNU=; b=aTnnH/IvoAP0dTO4YyAz6snDZH/EnK649pI8vseLeIIk/gHz8jnjqZAFErHd93+gtA 4dKjPSsEC067vTkqqBKy7YXbVhu7rURhmxAh5DiZs81h35kDQ1y1EtOfpxHFw2I24Tsr 5MPaw/cah+GvEKtzuTng7ekFpIeRhFYIvb3Vyvz7F12kqeucF0qXn+L1AgYxKtHoLc1a y1PJwxtOKI/wLe0s/Y6dRzagGpC2euum1qBnCjJIKx6rCZ0oPa+GfaIwwmBaeiI4V0Xp p1z/J7mLntqut3mShmRCmFwi2EynYYG1DCHHVGbBS6MPIdz/sKMelhjJ0kYrtJMLvHe6 wACw== X-Gm-Message-State: APjAAAVfMrtVUc95Gywsz1Q6adTfHXtlQb/fIlZpPJ1MoJY8+3fTdTch UrQ03I2XXivwDUuBKGR6m7c= X-Google-Smtp-Source: APXvYqxH5qWVV7GiPIQSRUOl8tWx+SCjNbiwmiT7wPh+kbVDKGNznpkXFCASeEieW4zHpb/QY2WTUg== X-Received: by 2002:a17:902:8549:: with SMTP id d9mr16011115plo.153.1581951900577; Mon, 17 Feb 2020 07:05:00 -0800 (PST) Received: from localhost ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id d14sm963793pjz.12.2020.02.17.07.04.59 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 17 Feb 2020 07:04:59 -0800 (PST) From: qiwuchen55@gmail.com To: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, chenqiwu Subject: [PATCH] mm/slub.c: replace cpu_slab->partial with wrapped APIs Date: Mon, 17 Feb 2020 23:04:55 +0800 Message-Id: <1581951895-3038-1-git-send-email-qiwuchen55@gmail.com> X-Mailer: git-send-email 1.9.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: From: chenqiwu There are slub_percpu_partial() and slub_set_percpu_partial() APIs to wrap kmem_cache->cpu_partial. This patch will use the two to replace cpu_slab->partial in slub code. Signed-off-by: chenqiwu --- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 17dc00e..15bb0ba 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2207,11 +2207,11 @@ static void unfreeze_partials(struct kmem_cache *s, struct kmem_cache_node *n = NULL, *n2 = NULL; struct page *page, *discard_page = NULL; - while ((page = c->partial)) { + while ((page = slub_percpu_partial(c))) { struct page new; struct page old; - c->partial = page->next; + slub_set_percpu_partial(c, page); n2 = get_node(s, page_to_nid(page)); if (n != n2) {