[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190328150851.5d261d1a72e2ca86a1c141c0@linux-foundation.org>
Date: Thu, 28 Mar 2019 15:08:51 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: George Spelvin <lkml@....org>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Andrey Abramov <st5pub@...dex.ru>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Daniel Wagner <daniel.wagner@...mens.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Don Mullis <don.mullis@...il.com>,
Dave Chinner <dchinner@...hat.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [RESEND PATCH v2 4/5] lib/list_sort: Simplify and remove
MAX_LIST_LENGTH_BITS
On Tue, 19 Mar 2019 08:16:00 +0000 George Spelvin <lkml@....org> wrote:
> Rather than a fixed-size array of pending sorted runs, use the ->prev
> links to keep track of things. This reduces stack usage, eliminates
> some ugly overflow handling, and reduces the code size.
>
> Also:
> * merge() no longer needs to handle NULL inputs, so simplify.
> * The same applies to merge_and_restore_back_links(), which is renamed
> to the less ponderous merge_final(). (It's a static helper function,
> so we don't need a super-descriptive name; comments will do.)
> * Document the actual return value requirements on the (*cmp)()
> function; some callers are already using this feature.
>
> x86-64 code size 1086 -> 739 bytes (-347)
>
> (Yes, I see checkpatch complaining about no space after comma in
> "__attribute__((nonnull(2,3,4,5)))". Checkpatch is wrong.)
x86_64 allnoconfig with gcc-7.3.0:
lib/list_sort.c:17:36: warning: __pure__ attribute ignored [-Wattributes]
struct list_head const *, struct list_head const *);
Powered by blists - more mailing lists