[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180322195819.24271-1-willy@infradead.org>
Date: Thu, 22 Mar 2018 12:58:15 -0700
From: Matthew Wilcox <willy@...radead.org>
To: linux-mm@...ck.org
Cc: Kirill Tkhai <ktkhai@...tuozzo.com>,
Matthew Wilcox <mawilcox@...rosoft.com>,
linux-kernel@...r.kernel.org,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: [PATCH 0/4] Add free() function
From: Matthew Wilcox <mawilcox@...rosoft.com>
Today, kfree_rcu() can only free objects allocated using kmalloc().
There have been attempts to extend that to kvfree(), but I think we
should take it even further and allow freeing as many different objects
as possible.
It turns out many different kinds of memory allocations can be detected
from the address. vmalloc() and percpu_alloc() can be detected by being
in a particular range. kmalloc() and kmem_cache_alloc() can be detected
from the struct page. __get_free_pages() and page_frag_alloc() are both
freeable just by decrementing the refcount on the page.
This allows us to delete many dozens of tiny rcu callbacks throughout
the kernel, much as was done when kfree_rcu was added.
Matthew Wilcox (4):
decompression: Rename malloc and free
Rename 'free' functions
mm: Add free()
rcu: Switch to using free() instead of kfree()
crypto/lrw.c | 4 ++--
crypto/xts.c | 4 ++--
include/linux/decompress/mm.h | 10 ++++++----
include/linux/kernel.h | 2 ++
include/linux/rcupdate.h | 40 +++++++++++++++++++---------------------
include/linux/rcutiny.h | 2 +-
include/linux/rcutree.h | 2 +-
include/trace/events/rcu.h | 8 ++++----
kernel/rcu/rcu.h | 8 +++-----
kernel/rcu/tree.c | 11 +++++------
mm/util.c | 39 +++++++++++++++++++++++++++++++++++++++
11 files changed, 84 insertions(+), 46 deletions(-)
--
2.16.2
Powered by blists - more mailing lists