[PATCH 0/4] Add free() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux