From patchwork Tue Apr 28 20:58:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 11515583 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 DAC791805 for ; Tue, 28 Apr 2020 21:00:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9169E20775 for ; Tue, 28 Apr 2020 21:00:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B7vt3KAj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9169E20775 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 654D18E0014; Tue, 28 Apr 2020 16:59:49 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6065B8E0007; Tue, 28 Apr 2020 16:59:49 -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 432CA8E0014; Tue, 28 Apr 2020 16:59:49 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 276F08E0007 for ; Tue, 28 Apr 2020 16:59:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D9D6A2C8B for ; Tue, 28 Apr 2020 20:59:48 +0000 (UTC) X-FDA: 76758480456.11.grip70_55a67e09d1f51 X-Spam-Summary: 2,0,0,8c5ced6be5b54fc8,d41d8cd98f00b204,urezki@gmail.com,,RULES_HIT:41:355:379:421:541:800:960:965:966:973:988:989:1260:1311:1314:1345:1359:1437:1515:1535:1544:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2693:2731:2914:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3870:3871:3872:3873:3874:4118:4321:4385:4390:4395:4605:5007:6261:6653:7514:9413:10004:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:12986:13161:13229:13894:14096:14181:14394:14687:14721:21080:21212:21433:21444:21451:21627:21666:21740:30034:30054,0,RBL:209.85.208.193:@gmail.com:.lbl8.mailshell.net-62.18.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:25,LUA_SUMMARY:none X-HE-Tag: grip70_55a67e09d1f51 X-Filterd-Recvd-Size: 7531 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Apr 2020 20:59:48 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id j3so211005ljg.8 for ; Tue, 28 Apr 2020 13:59:48 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=ZcJCHqE992p8lsmYiNcd24tMBqJtWQITQ3c5M8uA1SE=; b=B7vt3KAj4STTD+aKk+oKLMBs8qtai99+vCn8DipCi33bQwwq8BigFQl81rlWBL8xxm 5XMRocUMMayL6zNBfm8OnD5TDM6DSKI0IpCsuXRept5MT/XdGUKtiPMkbvt60gd5dq7O J1fDvz0SaOMR9WdM0zfuglp5AG/s4mH9e85cU5CT18sNbyTiVWN7lhYDQVVQ3CDH1ehB X4ON7co7BedfN0OLXCG5hwNQabjo2tdqaRqOpbKUSSrYTH6tV9P1jPvDlf+sLgzoENaB T4kOKoIQxciE6zMh912qt9MwSEmpnpTfeuxC4eTn0tSzskHowIUzt3PV0p5W3M82w6MV 5+jQ== 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=ZcJCHqE992p8lsmYiNcd24tMBqJtWQITQ3c5M8uA1SE=; b=WUE/b3wQGCs2+5tjsp5y+trs48l5+i7wUlEJxMgxp9QW/nIGvkhiTkbyWgAzo+7wpd 9Mg5lr6idK/4hJwO7vjLfHRm4oitO76u7+oK5br2RlMhEF5nEPpWnavKWffBvWrNGbXJ YMgdvr0XHvFiLncn8HSNR9VJuKrD1VU8kJVOgHGXNx33zAsfg7FIWmoZ+uA/O7JYEymq wsEvuPuT7ie8Hu1UlHPWc6M7KsD8xJkSV8Yj+stOVnVH+FrYfGi3IPqBO2NBP6l26kPf aP+QOJBKxKMip5NLs8Ije4G5WhCMbTRVND6AUp76eoIeS0aPlIMtJVHua7Ht0+C2nc0+ yyrQ== X-Gm-Message-State: AGi0Pua0MlaI/4RIqgDwuqWpECauhiWDly3douGN62BV4ayA7KwIuRO4 x9E5JLVcBpYRLOJ+83KhQR4= X-Google-Smtp-Source: APiQypIZsg28yYvjCdQRmrdaF5z9OdGgbIG1meF5iEoqlsZSntvvbPCTGsJPR0M5i7zF9h+4vPIP2A== X-Received: by 2002:a2e:9a82:: with SMTP id p2mr19047796lji.279.1588107587186; Tue, 28 Apr 2020 13:59:47 -0700 (PDT) Received: from pc638.lan (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id z21sm295483ljh.42.2020.04.28.13.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 13:59:46 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: LKML , linux-mm@kvack.org Cc: Andrew Morton , "Paul E . McKenney" , "Theodore Y . Ts'o" , Matthew Wilcox , Joel Fernandes , RCU , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 15/24] rcu: Rename kfree_call_rcu() to the kvfree_call_rcu(). Date: Tue, 28 Apr 2020 22:58:54 +0200 Message-Id: <20200428205903.61704-16-urezki@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200428205903.61704-1-urezki@gmail.com> References: <20200428205903.61704-1-urezki@gmail.com> 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: The reason is, it is capable of freeing vmalloc() memory now. Do the same with __kfree_rcu() macro, it becomes __kvfree_rcu(), the reason is the same as pointed above. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Joel Fernandes (Google) Signed-off-by: Joel Fernandes (Google) --- include/linux/rcupdate.h | 8 ++++---- include/linux/rcutiny.h | 2 +- include/linux/rcutree.h | 2 +- kernel/rcu/tree.c | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 1d25e6c23ebd..b344fc800a9b 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -835,10 +835,10 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) /* * Helper macro for kfree_rcu() to prevent argument-expansion eyestrain. */ -#define __kfree_rcu(head, offset) \ +#define __kvfree_rcu(head, offset) \ do { \ BUILD_BUG_ON(!__is_kvfree_rcu_offset(offset)); \ - kfree_call_rcu(head, (rcu_callback_t)(unsigned long)(offset)); \ + kvfree_call_rcu(head, (rcu_callback_t)(unsigned long)(offset)); \ } while (0) /** @@ -857,7 +857,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) * Because the functions are not allowed in the low-order 4096 bytes of * kernel virtual memory, offsets up to 4095 bytes can be accommodated. * If the offset is larger than 4095 bytes, a compile-time error will - * be generated in __kfree_rcu(). If this error is triggered, you can + * be generated in __kvfree_rcu(). If this error is triggered, you can * either fall back to use of call_rcu() or rearrange the structure to * position the rcu_head structure into the first 4096 bytes. * @@ -872,7 +872,7 @@ do { \ typeof (ptr) ___p = (ptr); \ \ if (___p) \ - __kfree_rcu(&((___p)->rhf), offsetof(typeof(*(ptr)), rhf)); \ + __kvfree_rcu(&((___p)->rhf), offsetof(typeof(*(ptr)), rhf)); \ } while (0) /* diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 3465ba704a11..0c6315c4a0fe 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h @@ -34,7 +34,7 @@ static inline void synchronize_rcu_expedited(void) synchronize_rcu(); } -static inline void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func) +static inline void kvfree_call_rcu(struct rcu_head *head, rcu_callback_t func) { call_rcu(head, func); } diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index fbc26274af4d..4d2732442013 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -33,7 +33,7 @@ static inline void rcu_virt_note_context_switch(int cpu) } void synchronize_rcu_expedited(void); -void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func); +void kvfree_call_rcu(struct rcu_head *head, rcu_callback_t func); void rcu_barrier(void); bool rcu_eqs_special_set(int cpu); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 5f53368f2554..51726e4c3b4d 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3251,12 +3251,12 @@ kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu *krcp, void *ptr) * one, that is used only when the main path can not be maintained temporary, * due to memory pressure. * - * Each kfree_call_rcu() request is added to a batch. The batch will be drained + * Each kvfree_call_rcu() request is added to a batch. The batch will be drained * every KFREE_DRAIN_JIFFIES number of jiffies. All the objects in the batch will * be free'd in workqueue context. This allows us to: batch requests together to * reduce the number of grace periods during heavy kfree_rcu()/kvfree_rcu() load. */ -void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func) +void kvfree_call_rcu(struct rcu_head *head, rcu_callback_t func) { unsigned long flags; struct kfree_rcu_cpu *krcp; @@ -3295,7 +3295,7 @@ void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func) unlock_return: krc_this_cpu_unlock(krcp, flags); } -EXPORT_SYMBOL_GPL(kfree_call_rcu); +EXPORT_SYMBOL_GPL(kvfree_call_rcu); static unsigned long kfree_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)