From: Oscar Salvador <osalvador@suse.de>
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 <osalvador@suse.de>
Subject: [RFC PATCH v2 4/4] mm, sparse: rename kmalloc_section_memmap, __kfree_section_memmap
Date: Tue, 22 Jan 2019 11:37:08 +0100 [thread overview]
Message-ID: <20190122103708.11043-5-osalvador@suse.de> (raw)
In-Reply-To: <20190122103708.11043-1-osalvador@suse.de>
From: Michal Hocko <mhocko@suse.com>
The sufix "kmalloc" is misleading.
Rename it to alloc_section_memmap/free_section_memmap which
better reflects the funcionality.
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Oscar Salvador <osalvador@suse.de>
---
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;
}
--
2.13.7
next prev parent reply other threads:[~2019-01-22 10:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 10:37 [RFC PATCH v2 0/4] mm, memory_hotplug: allocate memmap from hotadded memory Oscar Salvador
2019-01-22 10:37 ` [RFC PATCH v2 1/4] mm, memory_hotplug: cleanup memory offline path Oscar Salvador
2019-01-22 10:37 ` [RFC PATCH v2 2/4] mm, memory_hotplug: provide a more generic restrictions for memory hotplug Oscar Salvador
2019-01-22 10:37 ` [RFC PATCH v2 3/4] mm, memory_hotplug: allocate memmap from the added memory range for sparse-vmemmap Oscar Salvador
2019-01-22 10:37 ` Oscar Salvador [this message]
2019-01-25 8:53 ` [RFC PATCH v2 0/4] mm, memory_hotplug: allocate memmap from hotadded memory David Hildenbrand
2019-01-29 8:43 ` Oscar Salvador
2019-01-29 10:08 ` David Hildenbrand
2019-01-30 21:52 ` Oscar Salvador
2019-01-31 7:23 ` Michal Hocko
2019-01-31 8:03 ` Oscar Salvador
2019-02-12 12:47 ` Jonathan Cameron
2019-02-12 13:21 ` Shameerali Kolothum Thodi
2019-02-12 13:56 ` Oscar Salvador
2019-02-12 14:42 ` Michal Hocko
2019-02-12 14:50 ` Oscar Salvador
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190122103708.11043-5-osalvador@suse.de \
--to=osalvador@suse.de \
--cc=Pavel.Tatashin@microsoft.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®