From patchwork Mon Mar 30 02:32:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 11464471 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 C96ED1392 for ; Mon, 30 Mar 2020 02:33:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7F9CC20735 for ; Mon, 30 Mar 2020 02:33:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="NmZKgN+R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F9CC20735 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=joelfernandes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9B4AF6B006C; Sun, 29 Mar 2020 22:33:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 93CA66B006E; Sun, 29 Mar 2020 22:33:36 -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 7E0066B0070; Sun, 29 Mar 2020 22:33:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0029.hostedemail.com [216.40.44.29]) by kanga.kvack.org (Postfix) with ESMTP id 5E3E16B006C for ; Sun, 29 Mar 2020 22:33:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5F785442C for ; Mon, 30 Mar 2020 02:33:36 +0000 (UTC) X-FDA: 76650457632.13.war82_59a75dc38fd1c X-Spam-Summary: 40,2.5,0,8f4df0230ed0f7ca,d41d8cd98f00b204,joel@joelfernandes.org,,RULES_HIT:41:355:379:541:800:960:965:966:973:988:989:1260:1311:1314:1345:1359:1437:1515:1535:1543:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3872:3874:4117:4250:4321:4385:4390:4395:4605:5007:6119:6261:6653:6742:7514:7576:7875:7903:10011:11026:11232:11473:11658:11914:12043:12114:12296:12297:12438:12517:12519:12555:12895:13894:14096:14181:14394:14721:21080:21433:21444:21451:21627:21740:21772:21987:21990:30054,0,RBL:209.85.222.195:@joelfernandes.org:.lbl8.mailshell.net-66.100.201.201 62.2.0.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:1:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: war82_59a75dc38fd1c X-Filterd-Recvd-Size: 6171 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Mar 2020 02:33:35 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id l25so17554929qki.7 for ; Sun, 29 Mar 2020 19:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MWGW0MR3qR5t+EjFJ/mWsxINnYeSYUXBIkqQcwzdLbg=; b=NmZKgN+R6zdEVE3IUCLOA6RtsN34sPbyKaa8mP1kEDPpsLSLDC2DRHp/Vjfoq2CUsJ 3z6jqV54GVqNx79lxtwaXeg+AIQWD+hvzHrkv8VABz1eDzoUfItrMN3CwpM0LL+n+bCv 013+kkgAk/r2Hrrd9cRQzHJsa+++wRfznqSKc= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=MWGW0MR3qR5t+EjFJ/mWsxINnYeSYUXBIkqQcwzdLbg=; b=PSCOqFQrEc9YqN0KS5H/RDvobyUaET8QQ9WgMBSRM3C+Slr9dTwVl8cq3Dj5GNu0Bq ab4mDai48X3NUPaNZsgZP49WOe4OikVXhbGUbG1cQ/XdWk+6EYtHIMcFD4t39+1csZCA oVK/F2Q43ZBCZkV8v39XEpkG8+y5XPTxQp026xFm5zmFULccmPps3+yPXC6aY+9yuuoo 4z4CacHlefbkGGonJ4E1C3fVlnAe5bi7d56/Z6chNSeE7E2xSehBatwiNI5/JmEx491J uyiE9mMHcxj1AMUOFGUpAGuHQa6CaoAXHcq8XXA1RfHJ7QcfsJThdm1uwnOReFijU1+p zTTg== X-Gm-Message-State: ANhLgQ3YsSy72esJwRIL7XTIq929N/7RmGS5CiNQsnGwt4IZEgLQ+n64 8lP//DOqlo1yAscT/mR1ikn4vQ== X-Google-Smtp-Source: ADFU+vvTztmnU9lpjasiqa10hSBSJgTl3WrD1Gxop2WglkZvO8iSitEjNNwX1ck2A7QnkhR469JcUg== X-Received: by 2002:a37:c43:: with SMTP id 64mr9826539qkm.47.1585535615138; Sun, 29 Mar 2020 19:33:35 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id q15sm10030625qtj.83.2020.03.29.19.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2020 19:33:34 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Uladzislau Rezki (Sony)" , Joel Fernandes , Andrew Morton , Ingo Molnar , Josh Triplett , Lai Jiangshan , linux-mm@kvack.org, Mathieu Desnoyers , "Paul E. McKenney" , "Rafael J. Wysocki" , rcu@vger.kernel.org, Steven Rostedt Subject: [PATCH 04/18] rcu: Rename __is_kfree_rcu_offset() macro Date: Sun, 29 Mar 2020 22:32:34 -0400 Message-Id: <20200330023248.164994-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog In-Reply-To: <20200330023248.164994-1-joel@joelfernandes.org> References: <20200330023248.164994-1-joel@joelfernandes.org> MIME-Version: 1.0 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: "Uladzislau Rezki (Sony)" Rename __is_kfree_rcu_offset to __is_kvfree_rcu_offset. All RCU paths use kvfree() now instead of kfree(), thus rename it. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Joel Fernandes (Google) Signed-off-by: Joel Fernandes (Google) --- include/linux/rcupdate.h | 6 +++--- kernel/rcu/tiny.c | 2 +- kernel/rcu/tree.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 8b7128d0860e2..c6f6a195cb1cd 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -823,16 +823,16 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) /* * Does the specified offset indicate that the corresponding rcu_head - * structure can be handled by kfree_rcu()? + * structure can be handled by kvfree_rcu()? */ -#define __is_kfree_rcu_offset(offset) ((offset) < 4096) +#define __is_kvfree_rcu_offset(offset) ((offset) < 4096) /* * Helper macro for kfree_rcu() to prevent argument-expansion eyestrain. */ #define __kfree_rcu(head, offset) \ do { \ - BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \ + BUILD_BUG_ON(!__is_kvfree_rcu_offset(offset)); \ kfree_call_rcu(head, (rcu_callback_t)(unsigned long)(offset)); \ } while (0) diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index 3dd8e6e207b09..aa897c3f2e92c 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c @@ -85,7 +85,7 @@ static inline bool rcu_reclaim_tiny(struct rcu_head *head) unsigned long offset = (unsigned long)head->func; rcu_lock_acquire(&rcu_callback_map); - if (__is_kfree_rcu_offset(offset)) { + if (__is_kvfree_rcu_offset(offset)) { trace_rcu_invoke_kvfree_callback("", head, offset); kvfree((void *)head - offset); rcu_lock_release(&rcu_callback_map); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 88b744ce896c0..1209945a34bfd 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2743,7 +2743,7 @@ __call_rcu(struct rcu_head *head, rcu_callback_t func) return; // Enqueued onto ->nocb_bypass, so just leave. // If no-CBs CPU gets here, rcu_nocb_try_bypass() acquired ->nocb_lock. rcu_segcblist_enqueue(&rdp->cblist, head); - if (__is_kfree_rcu_offset((unsigned long)func)) + if (__is_kvfree_rcu_offset((unsigned long)func)) trace_rcu_kvfree_callback(rcu_state.name, head, (unsigned long)func, rcu_segcblist_n_cbs(&rdp->cblist)); @@ -2937,7 +2937,7 @@ static void kfree_rcu_work(struct work_struct *work) rcu_lock_acquire(&rcu_callback_map); trace_rcu_invoke_kvfree_callback(rcu_state.name, head, offset); - if (!WARN_ON_ONCE(!__is_kfree_rcu_offset(offset))) + if (!WARN_ON_ONCE(!__is_kvfree_rcu_offset(offset))) kvfree((void *)head - offset); rcu_lock_release(&rcu_callback_map);