[PATCH 1/2] Convert target drivers to use sbitmap

2018-05-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The sbitmap and the percpu_ida perform essentially the same task, allocating tags for commands. Since the sbitmap is more used than the percpu_ida, convert the percpu_ida users to the sbitmap API. Signed-off-by: Matthew Wilcox

[PATCH 0/2] Use sbitmap instead of percpu_ida

2018-05-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a pretty rough-and-ready conversion of the target drivers from using percpu_ida to sbitmap. It compiles; I don't have a target setup, so it's completely untested. I haven't tried to do anything particularly clever here, so it's po

[PATCH 2/2] Remove percpu_ida

2018-05-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> With its one user gone, remove the library code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/percpu_ida.h | 83 lib/Makefile | 2 +- lib/percpu_ida.c

Re: [PATCH net-next 1/2] tcp: add TCP_ZEROCOPY_RECEIVE support for zerocopy receive

2018-04-25 Thread Matthew Wilcox
On Wed, Apr 25, 2018 at 09:20:55AM -0700, Eric Dumazet wrote: > On 04/25/2018 09:04 AM, Matthew Wilcox wrote: > > If you don't zap the page range, any of the CPUs in the system where > > any thread in this task have ever run may have a TLB entry pointing to > > this page ...

Re: [PATCH net-next 1/2] tcp: add TCP_ZEROCOPY_RECEIVE support for zerocopy receive

2018-04-25 Thread Matthew Wilcox
On Wed, Apr 25, 2018 at 06:01:02AM -0700, Eric Dumazet wrote: > On 04/24/2018 11:28 PM, Christoph Hellwig wrote: > > On Tue, Apr 24, 2018 at 10:27:21PM -0700, Eric Dumazet wrote: > >> When adding tcp mmap() implementation, I forgot that socket lock > >> had to be taken before

Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG

2018-04-24 Thread Matthew Wilcox
On Tue, Apr 24, 2018 at 08:29:14AM -0400, Mikulas Patocka wrote: > > > On Mon, 23 Apr 2018, Matthew Wilcox wrote: > > > On Mon, Apr 23, 2018 at 08:06:16PM -0400, Mikulas Patocka wrote: > > > Some bugs (such as buffer overflows) are better detected > > >

Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG

2018-04-23 Thread Matthew Wilcox
On Mon, Apr 23, 2018 at 08:06:16PM -0400, Mikulas Patocka wrote: > Some bugs (such as buffer overflows) are better detected > with kmalloc code, so we must test the kmalloc path too. Well now, this brings up another item for the collective TODO list -- implement redzone checks for vmalloc.

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-21 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 05:21:26PM -0400, Mikulas Patocka wrote: > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > > > On Fri, 20 Apr 2018, Michal Hocko wrote: > > > > No way. This is just wrong! First

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > On Fri, 20 Apr 2018, Michal Hocko wrote: > > No way. This is just wrong! First of all, you will explode most likely > > on many allocations of small sizes. Second, CONFIG_DEBUG_VM tends to be > > enabled quite often. > > You're an

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 03:08:52PM +0200, Michal Hocko wrote: > > In order to detect these bugs reliably I submit this patch that changes > > kvmalloc to always use vmalloc if CONFIG_DEBUG_VM is turned on. > > No way. This is just wrong! First of all, you will explode most likely > on many

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Matthew Wilcox
On Thu, Apr 19, 2018 at 12:12:38PM -0400, Mikulas Patocka wrote: > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > uses DMA-API on the returned memory or frees it with kfree. Such bugs were > found in the virtio-net driver, dm-integrity or RHEL7 powerpc-specific > code.

Re: [PATCH 000/109] remove in-kernel calls to syscalls

2018-03-29 Thread Matthew Wilcox
On Thu, Mar 29, 2018 at 01:22:37PM +0200, Dominik Brodowski wrote: > At least on 64-bit x86, it will likely be a hard requirement from v4.17 > onwards to not call system call functions in the kernel: It is better to > use use a different calling convention for system calls there, where > struct

Re: [PATCH v2 6/8] page_frag_cache: Use a mask instead of offset

2018-03-22 Thread Matthew Wilcox
On Thu, Mar 22, 2018 at 09:41:57AM -0700, Matthew Wilcox wrote: > On Thu, Mar 22, 2018 at 09:22:31AM -0700, Alexander Duyck wrote: > > You could just use the pfc->mask here instead of size - 1 just to > > avoid having to do the subtraction more than once assuming the > > c

Re: [PATCH v2 1/8] page_frag_cache: Remove pfmemalloc bool

2018-03-22 Thread Matthew Wilcox
On Thu, Mar 22, 2018 at 09:39:40AM -0700, Alexander Duyck wrote: > So I was just thinking about this and it would probably make more > sense to look at addressing this after you take care of your > conversion from size/offset to a mask. One thing with the mask is that > it should never reach 64K

Re: [PATCH v2 6/8] page_frag_cache: Use a mask instead of offset

2018-03-22 Thread Matthew Wilcox
On Thu, Mar 22, 2018 at 09:22:31AM -0700, Alexander Duyck wrote: > On Thu, Mar 22, 2018 at 8:31 AM, Matthew Wilcox <wi...@infradead.org> wrote: > > By combining 'va' and 'offset' into 'addr' and using a mask instead, > > we can save a compare-and-branch in the fast-

[PATCH v2 6/8] page_frag_cache: Use a mask instead of offset

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> By combining 'va' and 'offset' into 'addr' and using a mask instead, we can save a compare-and-branch in the fast-path of the allocator. This removes 4 instructions on x86 (both 32 and 64 bit). We can avoid storing the mask at all if w

[PATCH v2 2/8] page_frag_cache: Move slowpath code from page_frag_alloc

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Put all the unlikely code in __page_frag_cache_refill to make the fastpath code more obvious. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/page_alloc.c | 70 - 1

[PATCH v2 1/8] page_frag_cache: Remove pfmemalloc bool

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Save 4/8 bytes by moving the pfmemalloc indicator from its own bool to the top bit of pagecnt_bias. This has no effect on the fastpath of the allocator since the pagecnt_bias cannot go negative. It's a couple of extra instructions in the sl

[PATCH v2 4/8] page_frag_cache: Rename fragsz to size

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The 'size' variable name used to be used for the page size. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_a

[PATCH v2 8/8] page_frag: Account allocations

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Note the number of pages currently used in page_frag allocations. This may help diagnose leaks in page_frag users. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/mmzone.h | 3 ++- mm/page_alloc.c| 10 +

[PATCH v2 3/8] page_frag_cache: Rename 'nc' to 'pfc'

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This name was a legacy from the 'netdev_alloc_cache' days. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/page_alloc.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) dif

[PATCH v2 5/8] page_frag_cache: Save memory on small machines

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Only allocate a single page if CONFIG_BASE_SMALL is set. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/mm_types.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/mm_types.h b/include/linu

[PATCH v2 0/8] page_frag_cache improvements

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Version 1 was completely wrong-headed and I have repented of the error of my ways. Thanks for educating me. I still think it's possible to improve on the current state of the page_frag allocator, and here are eight patches, each of which I

[PATCH v2 7/8] page_frag: Update documentation

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> - Rename Documentation/vm/page_frags to page_frags.rst - Change page_frags.rst to be a user's guide rather than implementation detail. - Add kernel-doc for the page_frag allocator - Move implementation details to the comments in page_a

Re: [PATCH] mlx5: Remove call to ida_pre_get

2018-03-20 Thread Matthew Wilcox
On Tue, Mar 20, 2018 at 10:46:20AM -0400, David Miller wrote: > From: Maor Gottlieb > Date: Tue, 20 Mar 2018 14:41:49 +0200 > > > Saeed, Matan and I okay with this fix as well, it looks like it > > shouldn't impact on the insertion rate. > > I've applied this to net-next,

Re: [RFC 2/2] page_frag_cache: Store metadata in struct page

2018-03-16 Thread Matthew Wilcox
On Thu, Mar 15, 2018 at 02:26:28PM -0700, Alexander Duyck wrote: > On Thu, Mar 15, 2018 at 12:53 PM, Matthew Wilcox <wi...@infradead.org> wrote: > > From: Matthew Wilcox <mawil...@microsoft.com> > > > > Shrink page_frag_cache from 24 to 8 bytes (a single pointer t

Re: [PATCH] mlx5: Remove call to ida_pre_get

2018-03-15 Thread Matthew Wilcox
On Thu, Mar 15, 2018 at 11:58:07PM +, Saeed Mahameed wrote: > On Wed, 2018-03-14 at 19:57 -0700, Matthew Wilcox wrote: > > From: Matthew Wilcox <mawil...@microsoft.com> > > > > The mlx5 driver calls ida_pre_get() in a loop for no readily apparent > > reason

[RFC 1/2] mm: Use page->mapping to indicate pfmemalloc

2018-03-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> I want to use page->index for a different purpose, so move the pfmemalloc indicator from page->index to page->mapping. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/mm.h | 16 +--- mm

[RFC 0/2] Shrink page_frag_cache

2018-03-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> I've just learned about the page_frag_cache allocator, and now I want to use it everywhere ;-) But before I start using it in other places, I want to see if it can be improved at all. The pfmemalloc flag is pretty specific to how the network

[RFC 2/2] page_frag_cache: Store metadata in struct page

2018-03-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Shrink page_frag_cache from 24 to 8 bytes (a single pointer to the currently-in-use struct page) by using the page's refcount directly (instead of maintaining a bias) and storing our current progress through the page in the same bits currentl

Re: rfc: remove print_vma_addr ? (was Re: [PATCH 00/16] remove eight obsolete architectures)

2018-03-15 Thread Matthew Wilcox
On Thu, Mar 15, 2018 at 09:56:46AM -0700, Joe Perches wrote: > I have a patchset that creates a vsprintf extension for > print_vma_addr and removes all the uses similar to the > print_symbol() removal. > > This now avoids any possible printk interleaving. > > Unfortunately, without some #ifdef

[PATCH] mlx5: Remove call to ida_pre_get

2018-03-14 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The mlx5 driver calls ida_pre_get() in a loop for no readily apparent reason. The driver uses ida_simple_get() which will call ida_pre_get() by itself and there's no need to use ida_pre_get() unless using ida_get_new(). Signed-off-by: Matthew

Re: [RFC PATCH V1 01/12] audit: add container id

2018-03-02 Thread Matthew Wilcox
On Fri, Mar 02, 2018 at 10:48:42AM -0500, Paul Moore wrote: > On Thu, Mar 1, 2018 at 8:41 PM, Richard Guy Briggs wrote: > > On 2018-03-01 14:41, Richard Guy Briggs wrote: > FYI, I think you may have a problem with something in your outgoing > mail path; I didn't receive the

[GIT PULL] Fixes for IDR

2018-02-26 Thread Matthew Wilcox
14:39:30 -0500) Matthew Wilcox (2): radix tree test suite: Fix build idr: Fix handling of IDs above INT_MAX lib/idr.c | 13 --- tools/testing/radix-tree/idr-test.c

Re: [PATCH 0/2] mark some slabs as visible not mergeable

2018-02-24 Thread Matthew Wilcox
erefore this patch set adds a flag to slab to give another > reason to prevent merging, and then uses it in network code. This is exactly the solution I would have suggested. Note that SLUB has always had slab merging, so this tool has been broken since 2.6.22 on any kernel with CONFIG_SLUB.

Re: tcp_bind_bucket is missing from slabinfo

2018-02-24 Thread Matthew Wilcox
On Fri, Feb 23, 2018 at 10:50:30PM -0800, Stephen Hemminger wrote: > Somewhere back around 3.17 the kmem cache "tcp_bind_bucket" dropped out > of /proc/slabinfo. It turns out the ss command was dumpster diving > in slabinfo to determine the number of bound sockets and now it always > reports 0. >

Re: Fwd: Re: Kernel panic with 4.16-rc1 (and 4.16-rc2) running selftest

2018-02-23 Thread Matthew Wilcox
On Sat, Feb 24, 2018 at 01:49:35AM +, Chris Mi wrote: > To verify this patch, the following is a sanity test case: > > # tc qdisc delete dev $link ingress > /dev/null 2>&1; > # tc qdisc add dev $link ingress; > # tc filter add dev $link prio 1 protocol ip handle 0x8001 parent : >

Re: Fwd: Re: Kernel panic with 4.16-rc1 (and 4.16-rc2) running selftest

2018-02-23 Thread Matthew Wilcox
On Fri, Feb 23, 2018 Randy Dunlap wrote: > [add Matthew Wilcox; hopefully he can look/see] Thanks, Randy. I don't understand why nobody else thought to cc the author of the patch that it was bisected to ... > On 02/23/2018 04:13 PM, Cong Wang wrote: > > On Fri, Feb 23, 2018 at 3

Re: kmem_cache_attr (was Re: [PATCH 04/36] usercopy: Prepare for usercopy whitelisting)

2018-01-16 Thread Matthew Wilcox
On Tue, Jan 16, 2018 at 12:17:01PM -0600, Christopher Lameter wrote: > Draft patch of how the data structs could change. kmem_cache_attr is read > only. Looks good. Although I would add Kees' user feature: struct kmem_cache_attr { char name[16]; unsigned int size;

Re: kmem_cache_attr (was Re: [PATCH 04/36] usercopy: Prepare for usercopy whitelisting)

2018-01-16 Thread Matthew Wilcox
On Tue, Jan 16, 2018 at 10:54:27AM -0600, Christopher Lameter wrote: > On Tue, 16 Jan 2018, Matthew Wilcox wrote: > > > I think that's a good thing! /proc/slabinfo really starts to get grotty > > above 16 bytes. I'd like to chop off "_cache" from the n

Re: kmem_cache_attr (was Re: [PATCH 04/36] usercopy: Prepare for usercopy whitelisting)

2018-01-16 Thread Matthew Wilcox
On Tue, Jan 16, 2018 at 09:21:30AM -0600, Christopher Lameter wrote: > > struct kmem_cache_attr { > > const char name[32]; > > Want to avoid the string reference mess that occurred in the past? > Is that really necessary? But it would limit the size of the name. I think that's a good thing!

Re: [PATCH 04/36] usercopy: Prepare for usercopy whitelisting

2018-01-14 Thread Matthew Wilcox
On Wed, Jan 10, 2018 at 12:28:23PM -0600, Christopher Lameter wrote: > On Tue, 9 Jan 2018, Kees Cook wrote: > > +struct kmem_cache *kmem_cache_create_usercopy(const char *name, > > + size_t size, size_t align, slab_flags_t flags, > > + size_t useroffset, size_t

Re: [PATCH 13/38] ext4: Define usercopy region in ext4_inode_cache slab cache

2018-01-14 Thread Matthew Wilcox
On Thu, Jan 11, 2018 at 03:05:14PM -0800, Kees Cook wrote: > On Thu, Jan 11, 2018 at 9:01 AM, Theodore Ts'o wrote: > > On Wed, Jan 10, 2018 at 06:02:45PM -0800, Kees Cook wrote: > >> The ext4 symlink pathnames, stored in struct ext4_inode_info.i_data > >> and therefore contained in

[PATCH v2 01/17] idr: Fix build

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The IDR calls WARN_ON without including Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/idr.h b/include/linux/idr.h index 7c3a365f7e12..

[PATCH v2 07/17] idr: Delete idr_find_ext function

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Simply changing idr_remove's 'id' argument to 'unsigned long' works for all callers. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h| 7 +-- net/sched/act_api.c| 2 +- net/sched/cls_flower.c | 2

[PATCH v2 17/17] idr: Warn if old iterators see large IDs

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Now that the IDR can be used to store large IDs, it is possible somebody might only partially convert their old code and use the iterators which can only handle IDs up to INT_MAX. It's probably unwise to show them a truncated ID, so

[PATCH v2 16/17] idr: Rename idr_for_each_entry_ext

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Match idr_alloc_ul with idr_get_next_ul and idr_for_each_entry_ul. Also add kernel-doc. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h | 17 ++--- lib/idr.c | 20 +++

[PATCH v2 13/17] cls_u32: Reinstate cyclic allocation

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Commit e7614370d6f0 ("net_sched: use idr to allocate u32 filter handles) converted htid allocation to use the IDR. The ID allocated by this scheme changes; it used to be cyclic, but now always allocates the lowest available. The IDR supp

[PATCH v2 10/17] cls_basic: Convert to use idr_alloc_u32

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper which saves a temporary variable and a few lines of code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_basic.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deleti

[PATCH v2 12/17] cls_flower: Convert to idr_alloc_u32

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper which saves a temporary variable and a few lines of code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_flower.c | 26 ++ 1 file changed, 10 insertions(+), 16 deleti

[PATCH v2 11/17] cls_bpf: Convert to use idr_alloc_u32

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper. This has a modest reduction in both lines of code and compiled code size. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_bpf.c | 24 ++-- 1 file changed, 10 inser

[PATCH v2 06/17] idr: Delete idr_replace_ext function

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Changing idr_replace's 'id' argument to 'unsigned long' works for all callers. Callers which passed a negative ID now get -ENOENT instead of -EINVAL. No callers relied on this error value. Signed-off-by: Matthew Wilcox <mawil...@micr

[PATCH v2 08/17] idr: Add idr_alloc_u32 helper

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> All current users of idr_alloc_ext() actually want to allocate a u32 and it's a little painful for them to use idr_alloc_ext(). This convenience function makes it simple. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- i

[PATCH v2 15/17] idr: Rename idr_alloc_ext to idr_alloc_ul

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> idr_alloc_ul fits better with other parts of the Linux kernel where we need to name a function based on the types it operates on. It uses a 'nextid' pointer argument instead of separate minimum ID and output assigned ID, (like idr_get_next), re

[PATCH v2 14/17] cls_u32: Convert to idr_alloc_u32

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> No real benefit to this classifier, but since we're allocating a u32 anyway, we should use this function. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_u32.c | 7 +++ 1 file changed, 3 insertions(+),

[PATCH v2 05/17] idr: Delete idr_remove_ext function

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Simply changing idr_remove's 'id' argument to 'unsigned long' suffices for all callers. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h| 7 +-- net/sched/act_api.c| 2 +- net/sched/cls_

[PATCH v2 04/17] IDR test suite: Check handling negative end correctly

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> One of the charming quirks of the idr_alloc() interface is that you can pass a negative end and it will be interpreted as "maximum". Ensure we don't break that. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- tools/

[PATCH v2 00/17] IDR changes for v4.15-rc1

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> v2: - Rebased on f6454f80e8a965fca203dab28723f68ec78db608 to resolve conflicting changes with cls_bpf - Fix whitespace - Change a WARN_ON to WARN_ON_ONCE (git snafu yesterday) Original cover letter: The patches here are of three

[PATCH v2 02/17] radix tree test suite: Remove ARRAY_SIZE

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is now defined in tools/include/linux/kernel.h, so our definition generates a warning. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- tools/testing/radix-tree/linux/kernel.h | 2 -- 1 file changed, 2 deletions(-) diff -

[PATCH v2 03/17] idr test suite: Fix ida_test_random()

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The test was checking the wrong errno; ida_get_new_above() returns EAGAIN, not ENOMEM on memory allocation failure. Double the number of threads to increase the chance that we actually exercise this path during the test suite (it was a bit sp

[PATCH v2 09/17] net sched actions: Convert to use idr_alloc_u32

2017-11-29 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper. Also untangle the error path, and in so doing noticed that estimator generator failure would lead to us leaking an ID. Fix that bug. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/ac

Re: [PATCH 11/17] cls_bpf: Convert to use idr_alloc_u32

2017-11-29 Thread Matthew Wilcox
On Tue, Nov 28, 2017 at 05:08:40PM -0800, Jakub Kicinski wrote: > On Tue, 28 Nov 2017 13:33:06 -0800, Matthew Wilcox wrote: > > + ret = idr_alloc_u32(>handle_idr, prog, , > > + INT_MAX, GFP_KERNEL); > >

[PATCH 16/17] idr: Rename idr_for_each_entry_ext

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Match idr_alloc_ul with idr_get_next_ul and idr_for_each_entry_ul. Also add kernel-doc. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h | 17 ++--- lib/idr.c | 20 +++

[PATCH 01/17] idr: Fix build

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The IDR calls WARN_ON without including Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/idr.h b/include/linux/idr.h index 7c3a365f7e12..

[PATCH 17/17] idr: Warn if old iterators see large IDs

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Now that the IDR can be used to store large IDs, it is possible somebody might only partially convert their old code and use the iterators which can only handle IDs up to INT_MAX. It's probably unwise to show them a truncated ID, so

[PATCH 03/17] idr test suite: Fix ida_test_random()

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The test was checking the wrong errno; ida_get_new_above() returns EAGAIN, not ENOMEM on memory allocation failure. Double the number of threads to increase the chance that we actually exercise this path during the test suite (it was a bit sp

[PATCH 04/17] IDR test suite: Check handling negative end correctly

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> One of the charming quirks of the idr_alloc() interface is that you can pass a negative end and it will be interpreted as "maximum". Ensure we don't break that. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- tools/

[PATCH 05/17] idr: Delete idr_remove_ext function

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Simply changing idr_remove's 'id' argument to 'unsigned long' suffices for all callers. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h| 7 +-- net/sched/act_api.c| 2 +- net/sched/cls_

[PATCH 14/17] cls_u32: Convert to idr_alloc_u32

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> No real benefit to this classifier, but since we're allocating a u32 anyway, we should use this function. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_u32.c | 7 +++ 1 file changed, 3 insertions(+),

[PATCH 13/17] cls_u32: Reinstate cyclic allocation

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Commit e7614370d6f0 ("net_sched: use idr to allocate u32 filter handles) converted htid allocation to use the IDR. The ID allocated by this scheme changes; it used to be cyclic, but now always allocates the lowest available. The IDR supp

[PATCH 08/17] idr: Add idr_alloc_u32 helper

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> All current users of idr_alloc_ext() actually want to allocate a u32 and it's a little painful for them to use idr_alloc_ext(). This convenience function makes it simple. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- i

[PATCH 07/17] idr: Delete idr_find_ext function

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Simply changing idr_remove's 'id' argument to 'unsigned long' works for all callers. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h| 7 +-- net/sched/act_api.c| 2 +- net/sched/cls_flower.c | 2

[PATCH 00/17] IDR patches for 4.15

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@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' I

[PATCH 09/17] net sched actions: Convert to use idr_alloc_u32

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper. Also untangle the error path, and in so doing noticed that estimator generator failure would lead to us leaking an ID. Fix that bug. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/ac

[PATCH 10/17] cls_basic: Convert to use idr_alloc_u32

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper which saves a temporary variable and a few lines of code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_basic.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deleti

[PATCH 06/17] idr: Delete idr_replace_ext function

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Changing idr_replace's 'id' argument to 'unsigned long' works for all callers. Callers which passed a negative ID now get -ENOENT instead of -EINVAL. No callers relied on this error value. Signed-off-by: Matthew Wilcox <mawil...@micr

[PATCH 12/17] cls_flower: Convert to idr_alloc_u32

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper which saves a temporary variable and a few lines of code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_flower.c | 26 ++ 1 file changed, 10 insertions(+), 16 deleti

[PATCH 02/17] radix tree test suite: Remove ARRAY_SIZE

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is now defined in tools/include/linux/kernel.h, so our definition generates a warning. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- tools/testing/radix-tree/linux/kernel.h | 2 -- 1 file changed, 2 deletions(-) diff -

[PATCH 15/17] idr: Rename idr_alloc_ext to idr_alloc_ul

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> idr_alloc_ul fits better with other parts of the Linux kernel where we need to name a function based on the types it operates on. It uses a 'nextid' pointer argument instead of separate minimum ID and output assigned ID, (like idr_get_next), re

[PATCH 11/17] cls_bpf: Convert to use idr_alloc_u32

2017-11-28 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the new helper. This has a modest reduction in both lines of code and compiled code size. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- net/sched/cls_bpf.c | 24 ++-- 1 file changed, 10 inser

Re: [PATCH net-next 2/2] ncpfs: move net/ncpfs to drivers/staging/ncpfs

2017-11-14 Thread Matthew Wilcox
On Sun, Nov 12, 2017 at 11:22:27AM -0800, Stephen Hemminger wrote: > The Netware Core Protocol is a file system that talks to > Netware clients over IPX. Since IPX has been dead for many years > move the file system into staging for eventual interment. Should probably cc Petr on this ... (added)

Re: [PATCH 00/12] radix-tree: split out struct radix_tree_root out to

2017-10-10 Thread Matthew Wilcox
On Tue, Oct 10, 2017 at 09:56:22PM +0900, Masahiro Yamada wrote: > One refactoring alone does not produce much benefits, > but making continuous efforts will disentangle the knotted threads. > Of course, this might be a pipe dream... A lot of people have had that dream, and some of those

Re: [PATCH 00/12] radix-tree: split out struct radix_tree_root out to

2017-10-10 Thread Matthew Wilcox
On Mon, Oct 09, 2017 at 01:10:01AM +0900, Masahiro Yamada wrote: > Reducing the header dependency will help for speeding the kernel > build, suppressing unnecessary recompile of objects during > git-bisect'ing, etc. Well, does it? You could provide measurements showing before/after time to

Extended IDR API

2017-09-11 Thread Matthew Wilcox
you have any plans to add test cases? (Compile tested only; I'm at a conference. Also, I didn't check the kerneldoc because I don't have Sphinx installed on my laptop.) >From ff45b2a6806cd0e4177c5a10f26c97999164c10c Mon Sep 17 00:00:00 2001 From: Matthew Wilcox <mawil...@microsoft.com>

Re: in_irq_or_nmi()

2017-03-29 Thread Matthew Wilcox
On Wed, Mar 29, 2017 at 11:19:49AM +0200, Peter Zijlstra wrote: > On Wed, Mar 29, 2017 at 10:59:28AM +0200, Jesper Dangaard Brouer wrote: > > On Wed, 29 Mar 2017 10:12:19 +0200 > > Peter Zijlstra wrote: > > > No, that's horrible. Also, wth is this about? A memory allocator

in_irq_or_nmi()

2017-03-27 Thread Matthew Wilcox
On Mon, Mar 27, 2017 at 05:15:00PM +0200, Jesper Dangaard Brouer wrote: > And I also verified it worked: > > 0.63 │ mov__preempt_count,%eax >│ free_hot_cold_page(): > 1.25 │ test $0x1f,%eax >│ ↓ jne1e4 > > And this simplification also made

Re: Page allocator order-0 optimizations merged

2017-03-27 Thread Matthew Wilcox
On Mon, Mar 27, 2017 at 02:39:47PM +0200, Jesper Dangaard Brouer wrote: > > +static __always_inline int in_irq_or_nmi(void) > +{ > + return in_irq() || in_nmi(); > +// XXX: hoping compiler will optimize this (todo verify) into: > +// #define in_irq_or_nmi() (preempt_count() & (HARDIRQ_MASK

RE: [PATCH 1/2] include: Fix checkpatch whitespace error and warning

2017-02-12 Thread Matthew Wilcox
Don't worry about this file; I have a complete rewrite already queued. > -Original Message- > From: Tobin C. Harding [mailto:m...@tobin.cc] > Sent: Saturday, February 11, 2017 9:58 PM > To: David S . Miller <da...@davemloft.net> > Cc: Matthew Wilcox <mawil..

Re: [Lsf] [Lsf-pc] [LSF/MM TOPIC] Generic page-pool recycle facility?

2016-04-11 Thread Matthew Wilcox
On Mon, Apr 11, 2016 at 02:08:27PM +0100, Mel Gorman wrote: > On Mon, Apr 11, 2016 at 02:26:39PM +0200, Jesper Dangaard Brouer wrote: > > On arch's like PowerPC, the DMA API is the bottleneck. To workaround > > the cost of DMA calls, NIC driver alloc large order (compound) pages. > > (dma_map

Re: [PATCH] MAINTAINERS: remove Adam Fritzler, update his email address in other sources

2007-12-18 Thread Matthew Wilcox
On Mon, Dec 17, 2007 at 08:48:03PM -0800, Joe Perches wrote: diff --git a/MAINTAINERS b/MAINTAINERS index 9507b42..690f172 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3758,13 +3758,6 @@ W: http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/ T: git

Re: [BUG] New Kernel Bugs

2007-11-14 Thread Matthew Wilcox
On Wed, Nov 14, 2007 at 12:46:20AM -0700, Denys Vlasenko wrote: Finally they replied and asked to rediff it against their git tree. I did that and sent patches back. No reply since then. And mind you, the patch is not trying to do anything complex, it mostly moves code around, removes

Re: [BUG] New Kernel Bugs

2007-11-13 Thread Matthew Wilcox
On Tue, Nov 13, 2007 at 12:50:08PM -0500, Mark Lord wrote: It's a 540MByte download over a slow link for everyone else. Where do you get this number from? $ du -sh .git/objects/pack/ 249M.git/objects/pack/ $ du -sh .git/objects/ 253M.git/objects/ ie about half what you claim. -- Intel

Re: [BUG] New Kernel Bugs

2007-11-13 Thread Matthew Wilcox
On Tue, Nov 13, 2007 at 01:43:53PM -0500, Mark Lord wrote: Matthew Wilcox wrote: ie about half what you claim. .. No, it's from earlier in this very thread: Adrian Bunk wrote: git clone \ git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git .. mkdir t cd t git

Re: oops with recent wireless-dev tree

2007-08-30 Thread Matthew Wilcox
-get_settings) { Since Stephen's already bagged fixing this, I shan't send a patch. But if it includes something like the line above please add: Acked-by: Matthew Wilcox [EMAIL PROTECTED] -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're

Re: oops with recent wireless-dev tree

2007-08-30 Thread Matthew Wilcox
On Thu, Aug 30, 2007 at 05:01:31PM +0200, Johannes Berg wrote: Jochen had a patch: http://marc.info/?l=linux-wirelessm=118842715026614w=2 That's exactly the right patch, please add Acked-by: Matthew Wilcox [EMAIL PROTECTED] I just checked over the commit that introduced the bug, and I didn't

Re: [PATCH] bridge: fix OOPS when bridging device without ethtool

2007-08-30 Thread Matthew Wilcox
without disturbing userspace. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] Acked-by: Matthew Wilcox [EMAIL PROTECTED] -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're interested in selling us this operating system, but compare

Re: [2.6 patch] unexport dev_ethtool

2007-08-14 Thread Matthew Wilcox
On Tue, Aug 14, 2007 at 11:22:03PM +0200, Adrian Bunk wrote: This patch removes the no longer used EXPORT_SYMBOL(dev_ethtool). Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Acked-by: Matthew Wilcox [EMAIL PROTECTED] -- Bill, look, we understand that you're interested in selling us

[PATCH] ethtool_perm_addr only has one implementation

2007-07-29 Thread Matthew Wilcox
All drivers implement ethtool get_perm_addr the same way -- by calling the generic function. So we can inline the generic function into the caller and avoid going through the drivers. Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] diff -u b/net/core/ethtool.c b/net/core/ethtool.c --- b/net

Re: [PATCH] Rewrite e100_phys_id

2006-11-07 Thread Matthew Wilcox
On Tue, Nov 07, 2006 at 10:33:14AM -0800, Auke Kok wrote: Matthew Wilcox wrote: Tested on the internal interface of an HP Integrity rx2600. bad news, it's completely hosed. The adapter does some indistinguishable blinking for a second, then stops blinking alltogether. Weird. I tested

[PATCH] Rewrite e100_phys_id

2006-10-26 Thread Matthew Wilcox
on the internal interface of an HP Integrity rx2600. Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] diff --git a/drivers/net/e100.c b/drivers/net/e100.c index a3a08a5..aade1e9 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -556,7 +556,6 @@ struct nic { struct params params; struct

  1   2   >