From patchwork Tue Jan 22 10:37:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10775337 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 A15741575 for ; Tue, 22 Jan 2019 10:37:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 910882A518 for ; Tue, 22 Jan 2019 10:37:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84E3C2A522; Tue, 22 Jan 2019 10:37:52 +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=-2.9 required=2.0 tests=BAYES_00,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 1DC952A518 for ; Tue, 22 Jan 2019 10:37:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E1158E0007; Tue, 22 Jan 2019 05:37:49 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 866108E0008; Tue, 22 Jan 2019 05:37:49 -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 61C448E0007; Tue, 22 Jan 2019 05:37:49 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 03AE78E0001 for ; Tue, 22 Jan 2019 05:37:49 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id e29so9296847ede.19 for ; Tue, 22 Jan 2019 02:37:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=ki6GX9ntNXP/ZqaJEHvMbVe3agDP7v8x4u4ZJC/W1g8=; b=c5pKZ61LGtsp/vkM0Ev5006HCzv7ywfAx2HPjPe9amyj6vy1DzYFWbBQl0KQM12ZtG l7yfdHksw9XFguLLXWiaw7jvEKay8cAbWrrF/tPS0NcVUKX9HYx7vLtYBj5PmIhnM1cu tHcvPFKAGAcHDgQm7pqMpxmEnUDVzIAF2xl8ERQ9fRenBNDIuju/opP5jqNghH8ViYs2 SI3WFAtA/TLcT/RuCz8cd7VmyGK57OBVyqT4ZdMygid5PER0wPp/BRqOpGBl/SZc7Y2h 7PtKC6Nw9iZucv9T+Pp9heFRMtUDWbw9Crf6N8Uzz4V2q01xvR4VXBBMOr42dHur6KBe x4uw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de X-Gm-Message-State: AJcUukfPs7x5KWBdt+iR9o4pojEJWBharLArP1dPqsCTbuHWWOAK6Jbj wGGzogCJ9h6H+vfSbr3S/mNncEU9ItE+hcRlXDSlSeqbuCK+IRlvHu8HauwJN9wguQSbrUlO3GS 91kaJcDqIELNz7iYgSevmqrBJOHIQ7aAWgv5jFvMtTTFu+xMgIIjbUd81fSQI8Bf8Mg== X-Received: by 2002:a17:906:4d2:: with SMTP id g18-v6mr27726456eja.182.1548153468397; Tue, 22 Jan 2019 02:37:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN4FsGFO35WBWtdO7+n8xd4ideK3BgMfd4cdNWKnFCYx0BEFFlrK6NGkFUFpg//20jY080gB X-Received: by 2002:a17:906:4d2:: with SMTP id g18-v6mr27726416eja.182.1548153467477; Tue, 22 Jan 2019 02:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548153467; cv=none; d=google.com; s=arc-20160816; b=mnTB0GhuxVeTSL+k1g3GD3jRzzfEXhWoG7Pp3EKZWu9ype77SNaDofqlmTZO4ad82J gpBfQWlUUwOfN60bQh454t/ce6wst+Nv3pZOW6v2NCc2Jv+ZPDxLdqMYRbkdJMH3jFJW 7nExhyWm9l+vMxjRsNvRh3egPDT2Ux9de839j3Os/NsnQHdkcS9RHnnkbQKuUNKQxuX4 OVyqQ+pNBU60s+9C3PtVu7q/lhlQlPR1Dy8aUGOTrGQGr5YArFnDwoqZDdcSPgPfawhs 0Ja334CTrN0DtchIhc+5Val+Hc9vVgzfFVBF8rV4zEzKIOlj1FjWETp6tlgfURoNF0Uo ufdQ== 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; bh=ki6GX9ntNXP/ZqaJEHvMbVe3agDP7v8x4u4ZJC/W1g8=; b=CGHYhCiVAmE9EAPZFDKAkHTOGMmER4FH377M0h1UvOcSGaFLnVrNm9MQ0hbDWlf56U X/TbKIwxF9Jyy/SXAqjYoxZLITj3qpEpsRlT3YqNPvTZVsYXwtIru02OfCttamyDQ42b NT5OkbRU3XBhMUg6hUD1FLMiNLA62GVnNMqXzo1g5O0szvoCFT2XVnSYEzTNAaH3jSPR znBGYR/GAMFRkVH/lxjMDpqtMQkakuDWuSvFG3HWMxU2/CPe+IEkTDXX6H4Qp33cxhRA 0WmlA3avkUpfsNFvO1ifAXTpwqU2lEKMMCmu8lPGJFtuW7dbBbrT0VqqSvps/CpWdCWE xffg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de Received: from smtp.nue.novell.com (smtp.nue.novell.com. [195.135.221.5]) by mx.google.com with ESMTPS id l9-v6si1158921ejh.293.2019.01.22.02.37.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 02:37:47 -0800 (PST) Received-SPF: pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) client-ip=195.135.221.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 22 Jan 2019 11:37:46 +0100 Received: from d104.suse.de (nwb-a10-snat.microfocus.com [10.120.13.202]) by emea4-mta.ukb.novell.com with ESMTP (NOT encrypted); Tue, 22 Jan 2019 10:37:21 +0000 From: Oscar Salvador To: linux-mm@kvack.org Cc: mhocko@suse.com, dan.j.williams@intel.com, Pavel.Tatashin@microsoft.com, david@redhat.com, linux-kernel@vger.kernel.org, dave.hansen@intel.com, Oscar Salvador Subject: [RFC PATCH v2 4/4] mm, sparse: rename kmalloc_section_memmap, __kfree_section_memmap Date: Tue, 22 Jan 2019 11:37:08 +0100 Message-Id: <20190122103708.11043-5-osalvador@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20190122103708.11043-1-osalvador@suse.de> References: <20190122103708.11043-1-osalvador@suse.de> 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 From: Michal Hocko The sufix "kmalloc" is misleading. Rename it to alloc_section_memmap/free_section_memmap which better reflects the funcionality. Signed-off-by: Michal Hocko Signed-off-by: Oscar Salvador --- mm/sparse.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index dd30468dc8f5..27428b965d46 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -676,13 +676,13 @@ static void free_deferred_vmemmap_range(unsigned long start, in_vmemmap_range = false; } -static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid, +static inline struct page *alloc_section_memmap(unsigned long pnum, int nid, struct vmem_altmap *altmap) { /* This will make the necessary allocations eventually. */ return sparse_mem_map_populate(pnum, nid, altmap); } -static void __kfree_section_memmap(struct page *memmap, +static void free_section_memmap(struct page *memmap, struct vmem_altmap *altmap) { unsigned long start = (unsigned long)memmap; @@ -732,13 +732,13 @@ static struct page *__kmalloc_section_memmap(void) return ret; } -static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid, +static inline struct page *alloc_section_memmap(unsigned long pnum, int nid, struct vmem_altmap *altmap) { return __kmalloc_section_memmap(); } -static void __kfree_section_memmap(struct page *memmap, +static void free_section_memmap(struct page *memmap, struct vmem_altmap *altmap) { if (is_vmalloc_addr(memmap)) @@ -803,12 +803,12 @@ int __meminit sparse_add_one_section(int nid, unsigned long start_pfn, if (ret < 0 && ret != -EEXIST) return ret; ret = 0; - memmap = kmalloc_section_memmap(section_nr, nid, altmap); + memmap = alloc_section_memmap(section_nr, nid, altmap); if (!memmap) return -ENOMEM; usemap = __kmalloc_section_usemap(); if (!usemap) { - __kfree_section_memmap(memmap, altmap); + free_section_memmap(memmap, altmap); return -ENOMEM; } @@ -830,7 +830,7 @@ int __meminit sparse_add_one_section(int nid, unsigned long start_pfn, out: if (ret < 0) { kfree(usemap); - __kfree_section_memmap(memmap, altmap); + free_section_memmap(memmap, altmap); } return ret; } @@ -881,7 +881,7 @@ static void free_section_usemap(struct page *memmap, unsigned long *usemap, if (PageSlab(usemap_page) || PageCompound(usemap_page)) { kfree(usemap); if (memmap) - __kfree_section_memmap(memmap, altmap); + free_section_memmap(memmap, altmap); return; }