linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] IDR patches for 4.15
@ 2017-11-28 21:32 Matthew Wilcox
  2017-11-28 21:32 ` [PATCH 01/17] idr: Fix build Matthew Wilcox
                   ` (16 more replies)
  0 siblings, 17 replies; 21+ messages in thread
From: Matthew Wilcox @ 2017-11-28 21:32 UTC (permalink / raw)
  Cc: Matthew Wilcox, Chris Mi, Jiri Pirko, David S . Miller,
	Cong Wang, Jamal Hadi Salim, Daniel Borkmann, Eric Biggers,
	Lai Jiangshan, Tejun Heo, Rehas Sachdeva, netdev, linux-kernel

From: Matthew Wilcox <mawilcox@microsoft.com>

The patches here are of three types:

 - Enhancing the test suite (fixing the build, adding a couple of new
   tests, fixing a bug in the test)
 - Replacing the 'extended' IDR API
 - Fixing some low-probability bugs 

As far as the 'extended' IDR API goes, this was added by Chris Mi to
permit a savvy user to use IDs up to ULONG_MAX in size (the traditional
IDR API only permits IDs to be INT_MAX).  It's harder to use, so we
wouldn't want to convert all users over to it.  But it can be made
easier to use than it currently is, which is what I've done here.  The
principal way that I've made it easier to use is by introducing
idr_alloc_u32(), which is what all but one of the existing users
actually want.

The last patch at the end I thought of just now -- what happens when
somebody adds an IDR entry with an ID > INT_MAX and then tries to
iterate over all entries in the IDR using an old interface that can't
return these large IDs?  It's not safe to return those IDs, so I've
settled for a dmesg warning and terminating the iteration.

Most of these patches have been sitting in my xarray tree in one form or
another for over a month.  I haven't seen anything from 0day to indicate
a problem here, but then there are as yet very few users and I'm not
sure 0day has covered any of them.

Matthew Wilcox (17):
  idr: Fix build
  radix tree test suite: Remove ARRAY_SIZE
  idr test suite: Fix ida_test_random()
  IDR test suite: Check handling negative end correctly
  idr: Delete idr_remove_ext function
  idr: Delete idr_replace_ext function
  idr: Delete idr_find_ext function
  idr: Add idr_alloc_u32 helper
  net sched actions: Convert to use idr_alloc_u32
  cls_basic: Convert to use idr_alloc_u32
  cls_bpf: Convert to use idr_alloc_u32
  cls_flower: Convert to idr_alloc_u32
  cls_u32: Reinstate cyclic allocation
  cls_u32: Convert to idr_alloc_u32
  idr: Rename idr_alloc_ext to idr_alloc_ul
  idr: Rename idr_for_each_entry_ext
  idr: Warn if old iterators see large IDs

 include/linux/idr.h                     | 109 ++++++++++--------------
 include/linux/radix-tree.h              |  17 +---
 lib/idr.c                               | 143 +++++++++++++++++++++++---------
 lib/radix-tree.c                        |   3 +-
 net/sched/act_api.c                     |  72 +++++++---------
 net/sched/cls_basic.c                   |  33 ++++----
 net/sched/cls_bpf.c                     |  32 ++++---
 net/sched/cls_flower.c                  |  34 ++++----
 net/sched/cls_u32.c                     |  51 +++++-------
 tools/testing/radix-tree/idr-test.c     |  22 ++++-
 tools/testing/radix-tree/linux/kernel.h |   2 -
 11 files changed, 267 insertions(+), 251 deletions(-)

-- 
2.15.0

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-11-29 16:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 21:32 [PATCH 00/17] IDR patches for 4.15 Matthew Wilcox
2017-11-28 21:32 ` [PATCH 01/17] idr: Fix build Matthew Wilcox
2017-11-28 21:32 ` [PATCH 02/17] radix tree test suite: Remove ARRAY_SIZE Matthew Wilcox
2017-11-28 21:32 ` [PATCH 03/17] idr test suite: Fix ida_test_random() Matthew Wilcox
2017-11-28 21:32 ` [PATCH 04/17] IDR test suite: Check handling negative end correctly Matthew Wilcox
2017-11-28 21:33 ` [PATCH 05/17] idr: Delete idr_remove_ext function Matthew Wilcox
2017-11-28 21:33 ` [PATCH 06/17] idr: Delete idr_replace_ext function Matthew Wilcox
2017-11-28 21:33 ` [PATCH 07/17] idr: Delete idr_find_ext function Matthew Wilcox
2017-11-28 21:33 ` [PATCH 08/17] idr: Add idr_alloc_u32 helper Matthew Wilcox
2017-11-28 21:33 ` [PATCH 09/17] net sched actions: Convert to use idr_alloc_u32 Matthew Wilcox
2017-11-28 21:33 ` [PATCH 10/17] cls_basic: " Matthew Wilcox
2017-11-28 21:33 ` [PATCH 11/17] cls_bpf: " Matthew Wilcox
2017-11-29  1:08   ` Jakub Kicinski
2017-11-29 16:29     ` Matthew Wilcox
2017-11-29 16:35       ` David Miller
2017-11-28 21:33 ` [PATCH 12/17] cls_flower: Convert to idr_alloc_u32 Matthew Wilcox
2017-11-28 21:33 ` [PATCH 13/17] cls_u32: Reinstate cyclic allocation Matthew Wilcox
2017-11-28 21:33 ` [PATCH 14/17] cls_u32: Convert to idr_alloc_u32 Matthew Wilcox
2017-11-28 21:33 ` [PATCH 15/17] idr: Rename idr_alloc_ext to idr_alloc_ul Matthew Wilcox
2017-11-28 21:33 ` [PATCH 16/17] idr: Rename idr_for_each_entry_ext Matthew Wilcox
2017-11-28 21:33 ` [PATCH 17/17] idr: Warn if old iterators see large IDs Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).