ABD optimized page allocation code

* Convert ABD to use the Linux Kernel scatterlist implementation
  instead of the hand rolled one from illumos.

* Scatter ABDs are preferentially populated with higher order
  compound pages from a single zone.  Allocation size is
  progressively decreased until it can be satisfied without
  performing reclaim or compaction.

* An alternate page allocator is provided for kernels older
  than 3.6 and for CONFIG_HIGHMEM systems.  This allocator
  is designed as a fallback for maximum compatibility.

* Extended abdstats to provide visibility in the the allocator.

* Add cached value for PAGESIZE in userspace.

Contributions-by:
Chunwei Chen <david.chen@osnexus.com>
Gvozden Neskovic <neskovic@gmail.com>
Jinshan Xiong <jinshan.xiong@intel.com>
Isaac Huang <he.huang@intel.com>
David Quigley <david.quigley@intel.com>
Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Chunwei Chen
2016-10-26 00:32:23 -04:00
committed by Brian Behlendorf
parent 4f60152910
commit 9829574834
5 changed files with 465 additions and 144 deletions
+5 -3
View File
@@ -43,7 +43,9 @@ extern "C" {
typedef enum abd_flags {
ABD_FLAG_LINEAR = 1 << 0, /* is buffer linear (or scattered)? */
ABD_FLAG_OWNER = 1 << 1, /* does it own its data buffers? */
ABD_FLAG_META = 1 << 2 /* does this represent FS metadata? */
ABD_FLAG_META = 1 << 2, /* does this represent FS metadata? */
ABD_FLAG_MULTI_ZONE = 1 << 3, /* pages split over memory zones */
ABD_FLAG_MULTI_CHUNK = 1 << 4 /* pages split over multiple chunks */
} abd_flags_t;
typedef struct abd {
@@ -54,8 +56,8 @@ typedef struct abd {
union {
struct abd_scatter {
uint_t abd_offset;
uint_t abd_chunk_size;
struct page *abd_chunks[];
uint_t abd_nents;
struct scatterlist *abd_sgl;
} abd_scatter;
struct abd_linear {
void *abd_buf;