)]}'
{
  "log": [
    {
      "commit": "704f15ddb5fc2a7f25a12eb0913302d8ad9ffab3",
      "tree": "ef17a945288c333c345643325783f374e10a4020",
      "parents": [
        "5bf54a9758c230d9e957e7b4f3a41c226660dd49"
      ],
      "author": {
        "name": "Jesse Gross",
        "email": "jesse@nicira.com",
        "time": "Thu May 26 16:25:02 2011 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu May 26 17:12:33 2011 -0700"
      },
      "message": "flex_array: avoid divisions when accessing elements\n\nOn most architectures division is an expensive operation and accessing an\nelement currently requires four of them.  This performance penalty\neffectively precludes flex arrays from being used on any kind of fast\npath.  However, two of these divisions can be handled at creation time and\nthe others can be replaced by a reciprocal divide, completely avoiding\nreal divisions on access.\n\n[eparis@redhat.com: rebase on top of changes to support 0 len elements]\n[eparis@redhat.com: initialize part_nr when array fits entirely in base]\nSigned-off-by: Jesse Gross \u003cjesse@nicira.com\u003e\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nCc: David Rientjes \u003crientjes@google.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "a8d05c81fb238bbb18878ccfae7599ca79448dd3",
      "tree": "b66baaf076be8f830cc07fb02ad22e2b3a9dd3e2",
      "parents": [
        "150cdf6ec0ede8d9f102f1817212447727dcf08c"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Apr 28 15:55:52 2011 -0400"
      },
      "committer": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Apr 28 15:56:07 2011 -0400"
      },
      "message": "flex_array: allow 0 length elements\n\nflex_arrays are supposed to be a replacement for:\nkmalloc(num_elements * sizeof(element))\n\nIf kmalloc is given 0 num_elements or a 0 size element it will happily return\nZERO_SIZE_PTR.  Which looks like a valid allocation, but which will explode if\nsomething actually try to use it.  The current flex_array code will return an\nequivalent result if num_elements is 0, but will fail to work if\nsizeof(element) is 0.  This patch allows allocation to work even for 0 size\nelements.  It will cause flex_arrays to explode though if they are used.\nImitating the kmalloc behavior.\n\nBased-on-patch-by: Steffen Klassert \u003csteffen.klassert@secunet.com\u003e\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\n"
    },
    {
      "commit": "150cdf6ec0ede8d9f102f1817212447727dcf08c",
      "tree": "4044554d4a6824c3ca9a13cad911019b21b8e9d2",
      "parents": [
        "5a3ea8782c63d3501cb764c176f153c0d9a400e1"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Apr 28 15:55:52 2011 -0400"
      },
      "committer": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Apr 28 15:56:07 2011 -0400"
      },
      "message": "flex_arrays: allow zero length flex arrays\n\nJust like kmalloc will allow one to allocate a 0 length segment of memory\nflex arrays should do the same thing.  It should bomb if you try to use\nsomething, but it should at least allow the allocation.\n\nThis is needed because when SELinux switched to using flex_arrays in 2.6.38\nthe inability to allocate a 0 length array resulted in SELinux policy load\nreturning -ENOSPC when previously it worked.\n\nBased-on-patch-by: Steffen Klassert \u003csteffen.klassert@secunet.com\u003e\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nTested-by: Chris Richards \u003cgizmo@giz-works.com\u003e\nCc: stable@kernel.org [2.6.38+]\n"
    },
    {
      "commit": "5a3ea8782c63d3501cb764c176f153c0d9a400e1",
      "tree": "3ff57105c8c3f3ad696b29511d1cf69f434caeab",
      "parents": [
        "562abf624175e3f8487b7f064e516805e437e597"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Apr 28 15:55:52 2011 -0400"
      },
      "committer": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Apr 28 15:56:06 2011 -0400"
      },
      "message": "flex_array: flex_array_prealloc takes a number of elements, not an end\n\nChange flex_array_prealloc to take the number of elements for which space\nshould be allocated instead of the last (inclusive) element. Users\nand documentation are updated accordingly.  flex_arrays got introduced before\nthey had users.  When folks started using it, they ended up needing a\ndifferent API than was coded up originally.  This swaps over to the API that\nfolks apparently need.\n\nBased-on-patch-by: Steffen Klassert \u003csteffen.klassert@secunet.com\u003e\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nTested-by: Chris Richards \u003cgizmo@giz-works.com\u003e\nAcked-by: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nCc: stable@kernel.org [2.6.38+]\n"
    },
    {
      "commit": "78c377d1b5e7ef15c8c307c2aa2511602a0829c3",
      "tree": "306f17444a4c5e190ff3b3513204910a386998e8",
      "parents": [
        "734825796446930c57f69677f2e6cf1683d012f2"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Wed Jan 12 16:59:55 2011 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Jan 13 08:03:11 2011 -0800"
      },
      "message": "flex_array: export symbols to modules\n\nAlex said:\n\n  I want to use flex_array to store a sparse array of ATM cell\n  re-assembly buffers for my ATM over Ethernet driver.  Using the per-vcc\n  user_back structure causes problems when stacked with things like\n  br2684.\n\nAdd EXPORT_SYMBOL() for all publically accessible flex array functions\nand move to obj-y so that modules may use this library.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nCc: Paul Mundt \u003clethal@linux-sh.org\u003e\nReported-by: Alex Bennee \u003ckernel-hacker@bennee.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "ea98eed9bcb62d1319db8b1210712c6a110a886c",
      "tree": "fa394336975862de7a1ca99f890eac4d3098356f",
      "parents": [
        "559b140a36613bb5b63f258b2ad833dad8cd11d9"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Mon Aug 09 17:20:56 2010 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Aug 09 20:45:09 2010 -0700"
      },
      "message": "flex_array: add helpers to get and put to make pointers easy to use\n\nGetting and putting arrays of pointers with flex arrays is a PITA.  You\nhave to remember to pass \u0026ptr to the _put and you have to do weird and\nwacky casting to get the ptr back from the _get.  Add two functions\nflex_array_get_ptr() and flex_array_put_ptr() to handle all of the magic.\n\n[akpm@linux-foundation.org: simplification suggested by Joe]\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nCc: David Rientjes \u003crientjes@google.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nCc: Joe Perches \u003cjoe@perches.com\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: Joe Perches \u003cjoe@perches.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "e59464c735db19619cde2aa331609adb02005f5b",
      "tree": "00849f207341841a7f5190c270fa0f82dcbda587",
      "parents": [
        "46da27664887fb95cedba53eafcf876de812c8c1"
      ],
      "author": {
        "name": "Changli Gao",
        "email": "xiaosuo@gmail.com",
        "time": "Fri Apr 23 13:17:45 2010 -0400"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Sat Apr 24 11:31:24 2010 -0700"
      },
      "message": "flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO\n\nmemset() is called with the wrong address and the kernel panics.\n\nSigned-off-by: Changli Gao \u003cxiaosuo@gmail.com\u003e\nCc: Patrick McHardy \u003ckaber@trash.net\u003e\nAcked-by: David Rientjes \u003crientjes@google.com\u003e\nCc: \u003cstable@kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "fc0d8d944df0c58cd810f33db82f87dcf5dcc190",
      "tree": "2fb3f712ce4ef5ddd615e145ec1f4afe8f03a689",
      "parents": [
        "45b588d6e5cc172704bac0c998ce54873b149b22"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Mon Sep 21 17:04:33 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Sep 22 07:17:47 2009 -0700"
      },
      "message": "flex_array: add missing kerneldoc annotations\n\nAdd kerneldoc annotations for function formals of type struct flex_array\nand gfp_t which are currently lacking.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nCc: Randy Dunlap \u003crandy.dunlap@oracle.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "45b588d6e5cc172704bac0c998ce54873b149b22",
      "tree": "57a9d3478af60fcf6932c1f61b083b9203ef1ee8",
      "parents": [
        "4af5a2f770cc8575840ccb1514ec76ecb592985c"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Mon Sep 21 17:04:33 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Sep 22 07:17:47 2009 -0700"
      },
      "message": "flex_array: introduce DEFINE_FLEX_ARRAY\n\nFLEX_ARRAY_INIT(element_size, total_nr_elements) cannot determine if\neither parameter is valid, so flex arrays which are statically allocated\nwith this interface can easily become corrupted or reference beyond its\nallocated memory.\n\nThis removes FLEX_ARRAY_INIT() as a struct flex_array initializer since no\ninitializer may perform the required checking.  Instead, the array is now\ndefined with a new interface:\n\n\tDEFINE_FLEX_ARRAY(name, element_size, total_nr_elements)\n\nThis may be prefixed with `static\u0027 for file scope.\n\nThis interface includes compile-time checking of the parameters to ensure\nthey are valid.  Since the validity of both element_size and\ntotal_nr_elements depend on FLEX_ARRAY_BASE_SIZE and FLEX_ARRAY_PART_SIZE,\nthe kernel build will fail if either of these predefined values changes\nsuch that the array parameters are no longer valid.\n\nSince BUILD_BUG_ON() requires compile time constants, several of the\nstatic inline functions that were once local to lib/flex_array.c had to be\nmoved to include/linux/flex_array.h.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nAcked-by: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "4af5a2f770cc8575840ccb1514ec76ecb592985c",
      "tree": "7af18234d7d171a946925e65e987fd51648be3aa",
      "parents": [
        "19da3dd157f8db6fe727ff268dab4791d55a6371"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Mon Sep 21 17:04:31 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Sep 22 07:17:47 2009 -0700"
      },
      "message": "flex_array: add flex_array_shrink function\n\nAdd a new function to the flex_array API:\n\n\tint flex_array_shrink(struct flex_array *fa)\n\nThis function will free all unused second-level pages.  Since elements are\nnow poisoned if they are not allocated with __GFP_ZERO, it\u0027s possible to\nidentify parts that consist solely of unused elements.\n\nflex_array_shrink() returns the number of pages freed.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "19da3dd157f8db6fe727ff268dab4791d55a6371",
      "tree": "4259074638b384e765c73542d74dd8f44750068b",
      "parents": [
        "e6de3988aa52debb25a427d085061f3bf1181d54"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Mon Sep 21 17:04:31 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Sep 22 07:17:47 2009 -0700"
      },
      "message": "flex_array: poison free elements\n\nNewly initialized flex_array\u0027s and/or flex_array_part\u0027s are now poisoned\nwith a new poison value, FLEX_ARRAY_FREE.  It\u0027s value is similar to\nPOISON_FREE used in the various slab allocators, but is different to\ndistinguish between flex array\u0027s poisoned kmem and slab allocator poisoned\nkmem.\n\nThis will allow us to identify flex_array_part\u0027s that only contain free\nelements (and free them with an addition to the flex_array API).  This\ncould also be extended in the future to identify `get\u0027 uses on elements\nthat have not been `put\u0027.\n\nIf __GFP_ZERO is passed for a part\u0027s gfp mask, the poisoning is avoided.\nThese elements are considered to be in-use since they have been\ninitialized.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "e6de3988aa52debb25a427d085061f3bf1181d54",
      "tree": "4a5dd6acac3e73049918c646bd977894335e5560",
      "parents": [
        "2f30b1f9e1b612cdd1a17daeecf514229e8d6a5f"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Mon Sep 21 17:04:30 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Sep 22 07:17:47 2009 -0700"
      },
      "message": "flex_array: add flex_array_clear function\n\nAdd a new function to the flex_array API:\n\n\tint flex_array_clear(struct flex_array *fa,\n\t\t\t\tunsigned int element_nr)\n\nThis function will zero the element at element_nr in the flex_array.\n\nAlthough this is equivalent to using flex_array_put() and passing a\npointer to zero\u0027d memory, flex_array_clear() does not require such a\npointer to memory that would most likely need to be allocated on the\ncaller\u0027s stack which could be significantly large depending on\nelement_size.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "b62e408c05228f40e69bb38a48db8961cac6cd23",
      "tree": "40711bad4a60adb8f331d71574ec61e13c5a352d",
      "parents": [
        "8e7ee27095aee87b5db1b0061e2ceea5878a1bbd"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Wed Aug 26 14:29:22 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Aug 26 20:06:52 2009 -0700"
      },
      "message": "flex_array: convert element_nr formals to unsigned\n\nIt\u0027s problematic to allow signed element_nr\u0027s or total\u0027s to be passed as\npart of the flex array API.\n\nflex_array_alloc() allows total_nr_elements to be set to a negative\nquantity, which is obviously erroneous.\n\nflex_array_get() and flex_array_put() allows negative array indices in\ndereferencing an array part, which could address memory mapped before\nstruct flex_array.\n\nThe fix is to convert all existing element_nr formals to be qualified as\nunsigned.  Existing checks to compare it to total_nr_elements or the max\narray size based on element_size need not be changed.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nCc: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "105b6e8a74cac11cdf70903877593c7f202075cc",
      "tree": "387b2ef2071481cf0abb2cd2aac331ee3a62548b",
      "parents": [
        "a30b595d2ca6d39e784a1bed5f2b35f3d7a03af7"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Wed Aug 26 14:29:20 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Aug 26 20:06:52 2009 -0700"
      },
      "message": "flex_array: fix flex_array_free_parts comment\n\nflex_array_free_parts() does not take `src\u0027 or `element_nr\u0027 formals, so\nremove their respective comments.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nAcked-by: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "a30b595d2ca6d39e784a1bed5f2b35f3d7a03af7",
      "tree": "101d1cdf6088a36a09ad5470a062331a74ab657d",
      "parents": [
        "054b2b13ccba4876a1ce98a7ede7dab7d6893d01"
      ],
      "author": {
        "name": "David Rientjes",
        "email": "rientjes@google.com",
        "time": "Wed Aug 26 14:29:20 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Aug 26 20:06:52 2009 -0700"
      },
      "message": "flex_array: fix get function for elements in base starting at non-zero\n\nIf all array elements fit into the base structure and data is copied using\nflex_array_put() starting at a non-zero index, flex_array_get() will fail\nto return the data.\n\nThis fixes the bug by only checking for NULL parts when all elements do\nnot fit in the base structure when flex_array_get() is used.  Otherwise,\nfa_element_to_part_nr() will always be 0 since there are no parts\nstructures needed and such element may never have been put.  Thus, it will\nremain NULL due to the kzalloc() of the base.\n\nAdditionally, flex_array_put() now only checks for a NULL part when all\nelements do not fit in the base structure.  This is otherwise unnecessary\nsince the base structure is guaranteed to exist (or we would have already\nhit a NULL pointer).\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nAcked-by: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "07868201070d87484bd00610a4921e879be78746",
      "tree": "262e32d1261bf05280a9711f6aa951550343979e",
      "parents": [
        "a40694a38a745af0dd7d8b796597ada1dd6caeb7"
      ],
      "author": {
        "name": "Jonathan Corbet",
        "email": "corbet@lwn.net",
        "time": "Tue Aug 04 13:35:17 2009 -0600"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Aug 04 15:33:46 2009 -0700"
      },
      "message": "flex_array: remove unneeded index calculation\n\nflex_array_get() calculates an index value, then drops it on the floor;\nsimply remove it.\n\nSigned-off-by: Jonathan Corbet \u003ccorbet@lwn.net\u003e\nAcked-by: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "534acc057b5a08ec33fa57cdd2f5a09ef124e7f2",
      "tree": "186e6ff90a7a696a2d15f183871250c9d83f476d",
      "parents": [
        "a9e58f25734e153b8c6516d904e2398fb8b0b23d"
      ],
      "author": {
        "name": "Dave Hansen",
        "email": "dave@linux.vnet.ibm.com",
        "time": "Wed Jul 29 15:04:18 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Jul 29 19:10:36 2009 -0700"
      },
      "message": "lib: flexible array implementation\n\nOnce a structure goes over PAGE_SIZE*2, we see occasional allocation\nfailures.  Some people have chosen to switch over to things like vmalloc()\nthat will let them keep array-like access to such a large structures.\nBut, vmalloc() has plenty of downsides.\n\nHere\u0027s an alternative.  I think it\u0027s what Andrew was suggesting here:\n\n\thttp://lkml.org/lkml/2009/7/2/518\n\nI call it a flexible array.  It does all of its work in PAGE_SIZE bits, so\nnever does an order\u003e0 allocation.  The base level has\nPAGE_SIZE-2*sizeof(int) bytes of storage for pointers to the second level.\n So, with a 32-bit arch, you get about 4MB (4183112 bytes) of total\nstorage when the objects pack nicely into a page.  It is half that on\n64-bit because the pointers are twice the size.  There\u0027s a table detailing\nthis in the code.\n\nThere are kerneldocs for the functions, but here\u0027s an\noverview:\n\nflex_array_alloc() - dynamically allocate a base structure\nflex_array_free() - free the array and all of the\n\t\t    second-level pages\nflex_array_free_parts() - free the second-level pages, but\n\t\t\t  not the base (for static bases)\nflex_array_put() - copy into the array at the given index\nflex_array_get() - copy out of the array at the given index\nflex_array_prealloc() - preallocate the second-level pages\n\t\t\tbetween the given indexes to\n\t\t\tguarantee no allocs will occur at\n\t\t\tput() time.\n\nWe could also potentially just pass the \"element_size\" into each of the\nAPI functions instead of storing it internally.  That would get us one\nmore base pointer on 32-bit.\n\nI\u0027ve been testing this by running it in userspace.  The header and patch\nthat I\u0027ve been using are here, as well as the little script I\u0027m using to\ngenerate the size table which goes in the kerneldocs.\n\n\thttp://sr71.net/~dave/linux/flexarray/\n\n[akpm@linux-foundation.org: coding-style fixes]\nSigned-off-by: Dave Hansen \u003cdave@linux.vnet.ibm.com\u003e\nReviewed-by: KAMEZAWA Hiroyuki \u003ckamezawa.hiroyu@jp.fujitsu.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    }
  ]
}
