Re: [PATCH v2] kyber: introduce kyber_depth_updated()

2021-02-22 Thread Omar Sandoval
g, but this looks correct, and it passed my tests. Reviewed-by: Omar Sandoval > --- > v2: > - Change the commit message > - Change from sbitmap::depth to 2^sbitmap::shift > --- > block/kyber-iosched.c | 29 + > 1 file changed, 13 insertions(+), 16 del

Re: [PATCH blktests v3 00/11] NVMe Target Passthru Block Tests

2020-10-22 Thread Omar Sandoval
On Thu, Oct 22, 2020 at 12:45:25PM -0600, Logan Gunthorpe wrote: > > On 2020-10-08 10:40 a.m., Logan Gunthorpe wrote: > > Hi, > > > > This series adds blktests for the nvmet passthru feature that was merged > > for 5.9. It's been reconciled with Sagi's blktest series that Omar > > recently

Re: [PATCH] kyber: Fix crash in kyber_finish_request()

2020-09-08 Thread Omar Sandoval
On Mon, Sep 07, 2020 at 10:41:16AM -0600, Jens Axboe wrote: > CC Omar > > On 9/7/20 1:43 AM, Yang Yang wrote: > > Kernel crash when requeue flush request. > > It can be reproduced as below: > > > > [2.517297] Unable to handle kernel paging request at virtual address > > ffd8071c0b00 > >

Re: [PATCH] sbitmap: trivial - update comment for sbitmap_deferred_clear_bit

2019-03-21 Thread Omar Sandoval
On Sat, Mar 16, 2019 at 04:24:37PM +0800, Shenghui Wang wrote: > "sbitmap_batch_clear" should be "sbitmap_deferred_clear" Acked-by: Omar Sandoval > Signed-off-by: Shenghui Wang > --- > include/linux/sbitmap.h | 2 +- > 1 file changed, 1 insertion(+), 1 de

Re: [PATCH 01/11] btrfs: add macros for compression type and level

2019-01-29 Thread Omar Sandoval
On Mon, Jan 28, 2019 at 04:24:27PM -0500, Dennis Zhou wrote: > It is very easy to miss places that rely on a certain bitshifting for > decyphering the type_level overloading. Make macros handle this instead. > > Signed-off-by: Dennis Zhou > --- > fs/btrfs/compression.c | 2 +- >

Re: [PATCH] block: aoe: no need to check return value of debugfs_create functions

2019-01-22 Thread Omar Sandoval
On Tue, Jan 22, 2019 at 04:21:04PM +0100, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: "Ed L. Cashin" > Cc: Jens Axboe

Re: [PATCH] blk_types.h: Use REQ_OP_WRITE in op_is_write

2019-01-11 Thread Omar Sandoval
On Sat, Dec 22, 2018 at 08:03:54AM -0200, Marcos Paulo de Souza wrote: > Instead of just using plain '1', as it improves readability. > > Signed-off-by: Marcos Paulo de Souza > --- > include/linux/blk_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH v3 01/10] sched: Provide sparsemask, a reduced contention bitmap

2018-12-06 Thread Omar Sandoval
On Thu, Dec 06, 2018 at 11:07:46AM -0500, Steven Sistare wrote: > On 11/27/2018 8:19 PM, Omar Sandoval wrote: > > On Tue, Nov 27, 2018 at 10:16:56AM -0500, Steven Sistare wrote: > >> On 11/9/2018 7:50 AM, Steve Sistare wrote: > >>> From: Steve Sistare > &g

Re: [PATCH v3 01/10] sched: Provide sparsemask, a reduced contention bitmap

2018-12-06 Thread Omar Sandoval
On Thu, Dec 06, 2018 at 11:07:46AM -0500, Steven Sistare wrote: > On 11/27/2018 8:19 PM, Omar Sandoval wrote: > > On Tue, Nov 27, 2018 at 10:16:56AM -0500, Steven Sistare wrote: > >> On 11/9/2018 7:50 AM, Steve Sistare wrote: > >>> From: Steve Sistare > &g

Re: [PATCH,1/2] genhd: avoid overflow of sectors in disk_stats

2018-11-30 Thread Omar Sandoval
On Fri, Nov 30, 2018 at 04:32:40AM -0500, Huijin Park wrote: > From: "huijin.park" > > This patch changes the 'sectors' type to an u64. > In 32 bit system, the 'sectors' can accumulate up to about 2TiB. > If a 32 bit system makes i/o over 2TiB while running, > the 'sectors' will overflow. > As a

Re: [PATCH,1/2] genhd: avoid overflow of sectors in disk_stats

2018-11-30 Thread Omar Sandoval
On Fri, Nov 30, 2018 at 04:32:40AM -0500, Huijin Park wrote: > From: "huijin.park" > > This patch changes the 'sectors' type to an u64. > In 32 bit system, the 'sectors' can accumulate up to about 2TiB. > If a 32 bit system makes i/o over 2TiB while running, > the 'sectors' will overflow. > As a

Re: [PATCH v3 01/10] sched: Provide sparsemask, a reduced contention bitmap

2018-11-27 Thread Omar Sandoval
On Tue, Nov 27, 2018 at 10:16:56AM -0500, Steven Sistare wrote: > On 11/9/2018 7:50 AM, Steve Sistare wrote: > > From: Steve Sistare > > > > Provide struct sparsemask and functions to manipulate it. A sparsemask is > > a sparse bitmap. It reduces cache contention vs the usual bitmap when many

Re: [PATCH v3 01/10] sched: Provide sparsemask, a reduced contention bitmap

2018-11-27 Thread Omar Sandoval
On Tue, Nov 27, 2018 at 10:16:56AM -0500, Steven Sistare wrote: > On 11/9/2018 7:50 AM, Steve Sistare wrote: > > From: Steve Sistare > > > > Provide struct sparsemask and functions to manipulate it. A sparsemask is > > a sparse bitmap. It reduces cache contention vs the usual bitmap when many

Re: linux-next: manual merge of the akpm-current tree with the btrfs-kdave tree

2018-10-05 Thread Omar Sandoval
On Fri, Oct 05, 2018 at 03:47:21PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the akpm-current tree got a conflict in: > > include/linux/swap.h > > between commit: > > 0f83d16b8f1f ("mm: split SWP_FILE into SWP_ACTIVATED and SWP_FS") > > from the btrfs-kdave

Re: linux-next: manual merge of the akpm-current tree with the btrfs-kdave tree

2018-10-05 Thread Omar Sandoval
On Fri, Oct 05, 2018 at 03:47:21PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the akpm-current tree got a conflict in: > > include/linux/swap.h > > between commit: > > 0f83d16b8f1f ("mm: split SWP_FILE into SWP_ACTIVATED and SWP_FS") > > from the btrfs-kdave

Re: linux-next: build warning after merge of the block tree

2018-09-28 Thread Omar Sandoval
On Fri, Sep 28, 2018 at 11:11:24AM +1000, Stephen Rothwell wrote: > Hi Jens, > > After merging the block tree, today's linux-next build (arm > multi_v7_defconfig) produced this warning: > > block/kyber-iosched.c:84:22: warning: integer overflow in expression of type > 'long int' results in

Re: linux-next: build warning after merge of the block tree

2018-09-28 Thread Omar Sandoval
On Fri, Sep 28, 2018 at 11:11:24AM +1000, Stephen Rothwell wrote: > Hi Jens, > > After merging the block tree, today's linux-next build (arm > multi_v7_defconfig) produced this warning: > > block/kyber-iosched.c:84:22: warning: integer overflow in expression of type > 'long int' results in

Re: [PATCH] btrfs: list usage cleanup

2018-09-27 Thread Omar Sandoval
On Wed, Sep 26, 2018 at 04:35:45PM +0800, zhong jiang wrote: > Trival cleanup, list_move_tail will implement the same function that > list_del() + list_add_tail() will do. hence just replace them. > > Signed-off-by: zhong jiang > --- > fs/btrfs/send.c | 3 +-- > 1 file changed, 1 insertion(+),

Re: [PATCH] btrfs: list usage cleanup

2018-09-27 Thread Omar Sandoval
On Wed, Sep 26, 2018 at 04:35:45PM +0800, zhong jiang wrote: > Trival cleanup, list_move_tail will implement the same function that > list_del() + list_add_tail() will do. hence just replace them. > > Signed-off-by: zhong jiang > --- > fs/btrfs/send.c | 3 +-- > 1 file changed, 1 insertion(+),

Re: [PATCH v3] proc/kcore: fix invalid memory access in multi-page read optimization

2018-09-04 Thread Omar Sandoval
not find any entry in the previous iteration > > Reset 'm' to NULL in that case at Omar Sandoval's suggestion. > > Fixes: bf991c2231117 ("proc/kcore: optimize multiple page reads") Reviewed-by: Omar Sandoval Thanks again for catching this! > Signed-off-by: Dominique Ma

Re: [PATCH v3] proc/kcore: fix invalid memory access in multi-page read optimization

2018-09-04 Thread Omar Sandoval
not find any entry in the previous iteration > > Reset 'm' to NULL in that case at Omar Sandoval's suggestion. > > Fixes: bf991c2231117 ("proc/kcore: optimize multiple page reads") Reviewed-by: Omar Sandoval Thanks again for catching this! > Signed-off-by: Dominique Ma

Re: [PATCH] proc/kcore: fix invalid memory access in multi-page read optimization

2018-09-04 Thread Omar Sandoval
On Wed, Aug 29, 2018 at 06:04:07AM +0200, Dominique Martinet wrote: > The 'm' kcore_list item can point to kclist_head, and it is incorrect to > look at m->addr / m->size in this case. > There is no choice but to run through the list of entries for every address > if we did not find any entry in

Re: [PATCH] proc/kcore: fix invalid memory access in multi-page read optimization

2018-09-04 Thread Omar Sandoval
On Wed, Aug 29, 2018 at 06:04:07AM +0200, Dominique Martinet wrote: > The 'm' kcore_list item can point to kclist_head, and it is incorrect to > look at m->addr / m->size in this case. > There is no choice but to run through the list of entries for every address > if we did not find any entry in

[PATCH v4 1/9] proc/kcore: don't grab lock for kclist_add()

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. While we're here, mark kclist_add() with __init so that we'll get a warning

[PATCH v4 1/9] proc/kcore: don't grab lock for kclist_add()

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. While we're here, mark kclist_add() with __init so that we'll get a warning

[PATCH v4 3/9] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

[PATCH v4 3/9] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

[PATCH v4 5/9] proc/kcore: hold lock during read

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 70 - 1 file changed

[PATCH v4 5/9] proc/kcore: hold lock during read

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 70 - 1 file changed

[PATCH v4 7/9] proc/kcore: optimize multiple page reads

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval The current code does a full search of the segment list every time for every page. This is wasteful, since it's almost certain that the next page will be in the same segment. Instead, check if the previous segment covers the current page before doing the list search. Signed

[PATCH v4 7/9] proc/kcore: optimize multiple page reads

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval The current code does a full search of the segment list every time for every page. This is wasteful, since it's almost certain that the next page will be in the same segment. Instead, check if the previous segment covers the current page before doing the list search. Signed

[PATCH v4 2/9] proc/kcore: don't grab lock for memory hotplug notifier

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval The memory hotplug notifier kcore_callback() only needs kclist_lock to prevent races with __kcore_update_ram(), but we can easily eliminate that race by using an atomic xchg() in __kcore_update_ram(). This is preparation for converting kclist_lock to an rwsem. Reviewed

[PATCH v4 6/9] proc/kcore: clean up ELF header generation

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Currently, the ELF file header, program headers, and note segment are allocated all at once, in some icky code dating back to 2.3. Programs tend to read the file header, then the program headers, then the note segment, all separately, so this is a waste of effort. It's

[PATCH v4 2/9] proc/kcore: don't grab lock for memory hotplug notifier

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval The memory hotplug notifier kcore_callback() only needs kclist_lock to prevent races with __kcore_update_ram(), but we can easily eliminate that race by using an atomic xchg() in __kcore_update_ram(). This is preparation for converting kclist_lock to an rwsem. Reviewed

[PATCH v4 6/9] proc/kcore: clean up ELF header generation

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Currently, the ELF file header, program headers, and note segment are allocated all at once, in some icky code dating back to 2.3. Programs tend to read the file header, then the program headers, then the note segment, all separately, so this is a waste of effort. It's

[PATCH v4 9/9] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient, and it only adds a page at most to the file. Signed-off-by: Omar Sandoval --- fs/proc

[PATCH v4 9/9] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient, and it only adds a page at most to the file. Signed-off-by: Omar Sandoval --- fs/proc

[PATCH v4 0/9] /proc/kcore improvements

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. It fixes a couple of small issues in v3 but is otherwise the same. Patches 1, 2, and 3 are prep patches. Patch 4 is a fix/cleanup. Patch 5 is another prep patch. Patches 6 and 7 are optimizations to ->read(). Patc

[PATCH v4 8/9] crash_core: use VMCOREINFO_SYMBOL_ARRAY() for swapper_pg_dir

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval This is preparation for allowing CRASH_CORE to be enabled for any architecture. swapper_pg_dir is always either an array or a macro expanding to NULL. In the latter case, VMCOREINFO_SYMBOL() won't work, as it tries to take the address of the given symbol: #define

[PATCH v4 4/9] proc/kcore: fix memory hotplug vs multiple opens race

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram

[PATCH v4 0/9] /proc/kcore improvements

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. It fixes a couple of small issues in v3 but is otherwise the same. Patches 1, 2, and 3 are prep patches. Patch 4 is a fix/cleanup. Patch 5 is another prep patch. Patches 6 and 7 are optimizations to ->read(). Patc

[PATCH v4 8/9] crash_core: use VMCOREINFO_SYMBOL_ARRAY() for swapper_pg_dir

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval This is preparation for allowing CRASH_CORE to be enabled for any architecture. swapper_pg_dir is always either an array or a macro expanding to NULL. In the latter case, VMCOREINFO_SYMBOL() won't work, as it tries to take the address of the given symbol: #define

[PATCH v4 4/9] proc/kcore: fix memory hotplug vs multiple opens race

2018-07-25 Thread Omar Sandoval
From: Omar Sandoval There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram

Re: [PATCH v3 5/8] proc/kcore: hold lock during read

2018-07-25 Thread Omar Sandoval
On Wed, Jul 25, 2018 at 12:11:26AM +0900, Tetsuo Handa wrote: > On 2018/07/19 7:58, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Now that we're using an rwsem, we can hold it during the entirety of > > read_kcore() and have a common return path. This is p

Re: [PATCH v3 5/8] proc/kcore: hold lock during read

2018-07-25 Thread Omar Sandoval
On Wed, Jul 25, 2018 at 12:11:26AM +0900, Tetsuo Handa wrote: > On 2018/07/19 7:58, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Now that we're using an rwsem, we can hold it during the entirety of > > read_kcore() and have a common return path. This is p

Re: linux-next: build failure after merge of the akpm-current tree

2018-07-25 Thread Omar Sandoval
On Mon, Jul 23, 2018 at 07:42:31PM +1000, Stephen Rothwell wrote: > Hi Andrew, > > After merging the akpm tree, today's linux-next build (sparc (32 bit) > defconfig) failed like this: > > In file included from kernel/crash_core.c:9:0: > kernel/crash_core.c: In function

Re: linux-next: build failure after merge of the akpm-current tree

2018-07-25 Thread Omar Sandoval
On Mon, Jul 23, 2018 at 07:42:31PM +1000, Stephen Rothwell wrote: > Hi Andrew, > > After merging the akpm tree, today's linux-next build (sparc (32 bit) > defconfig) failed like this: > > In file included from kernel/crash_core.c:9:0: > kernel/crash_core.c: In function

[PATCH v3 1/8] proc/kcore: don't grab lock for kclist_add()

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. While we're here, mark kclist_add() with __init so that we'll get a warning

[PATCH v3 1/8] proc/kcore: don't grab lock for kclist_add()

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. While we're here, mark kclist_add() with __init so that we'll get a warning

[PATCH v3 0/8] /proc/kcore improvements

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. Patches 1, 2, and 3 are prep patches. Patch 4 is a fix/cleanup. Patch 5 is another prep patch. Patches 6 and 7 are optimizations to ->read(). Patch 8 adds vmcoreinfo to /proc/kcore. Again, based on v4.18-rc4 + Ja

[PATCH v3 0/8] /proc/kcore improvements

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. Patches 1, 2, and 3 are prep patches. Patch 4 is a fix/cleanup. Patch 5 is another prep patch. Patches 6 and 7 are optimizations to ->read(). Patch 8 adds vmcoreinfo to /proc/kcore. Again, based on v4.18-rc4 + Ja

[PATCH v3 4/8] proc/kcore: fix memory hotplug vs multiple opens race

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram

[PATCH v3 6/8] proc/kcore: clean up ELF header generation

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Currently, the ELF file header, program headers, and note segment are allocated all at once, in some icky code dating back to 2.3. Programs tend to read the file header, then the program headers, then the note segment, all separately, so this is a waste of effort. It's

[PATCH v3 5/8] proc/kcore: hold lock during read

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 70 - 1 file changed

[PATCH v3 7/8] proc/kcore: optimize multiple page reads

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval The current code does a full search of the segment list every time for every page. This is wasteful, since it's almost certain that the next page will be in the same segment. Instead, check if the previous segment covers the current page before doing the list search. Signed

[PATCH v3 4/8] proc/kcore: fix memory hotplug vs multiple opens race

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram

[PATCH v3 6/8] proc/kcore: clean up ELF header generation

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Currently, the ELF file header, program headers, and note segment are allocated all at once, in some icky code dating back to 2.3. Programs tend to read the file header, then the program headers, then the note segment, all separately, so this is a waste of effort. It's

[PATCH v3 5/8] proc/kcore: hold lock during read

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 70 - 1 file changed

[PATCH v3 7/8] proc/kcore: optimize multiple page reads

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval The current code does a full search of the segment list every time for every page. This is wasteful, since it's almost certain that the next page will be in the same segment. Instead, check if the previous segment covers the current page before doing the list search. Signed

[PATCH v3 3/8] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

[PATCH v3 3/8] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

[PATCH v3 2/8] proc/kcore: don't grab lock for memory hotplug notifier

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval The memory hotplug notifier kcore_callback() only needs kclist_lock to prevent races with __kcore_update_ram(), but we can easily eliminate that race by using an atomic xchg() in __kcore_update_ram(). This is preparation for converting kclist_lock to an rwsem. Signed-off

[PATCH v3 8/8] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient, and it only adds a page at most to the file. Signed-off-by: Omar Sandoval --- fs/proc

[PATCH v3 2/8] proc/kcore: don't grab lock for memory hotplug notifier

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval The memory hotplug notifier kcore_callback() only needs kclist_lock to prevent races with __kcore_update_ram(), but we can easily eliminate that race by using an atomic xchg() in __kcore_update_ram(). This is preparation for converting kclist_lock to an rwsem. Signed-off

[PATCH v3 8/8] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-18 Thread Omar Sandoval
From: Omar Sandoval The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient, and it only adds a page at most to the file. Signed-off-by: Omar Sandoval --- fs/proc

Re: [PATCH v2 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 08:27:53PM -0700, Andrew Morton wrote: > On Tue, 17 Jul 2018 20:24:05 -0700 Omar Sandoval wrote: > > > > > --- a/fs/proc/kcore.c > > > > +++ b/fs/proc/kcore.c > > > > @@ -59,8 +59,8 @@ struct memelfnote > > > &g

Re: [PATCH v2 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 08:27:53PM -0700, Andrew Morton wrote: > On Tue, 17 Jul 2018 20:24:05 -0700 Omar Sandoval wrote: > > > > > --- a/fs/proc/kcore.c > > > > +++ b/fs/proc/kcore.c > > > > @@ -59,8 +59,8 @@ struct memelfnote > > > &g

Re: [PATCH v2 7/7] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 07:44:21PM -0700, Andrew Morton wrote: > On Thu, 12 Jul 2018 17:09:39 -0700 Omar Sandoval wrote: > > > From: Omar Sandoval > > > > The vmcoreinfo information is useful for runtime debugging tools, not > > just for crash dumps. A lot of this

Re: [PATCH v2 7/7] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 07:44:21PM -0700, Andrew Morton wrote: > On Thu, 12 Jul 2018 17:09:39 -0700 Omar Sandoval wrote: > > > From: Omar Sandoval > > > > The vmcoreinfo information is useful for runtime debugging tools, not > > just for crash dumps. A lot of this

Re: [PATCH v2 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 07:38:41PM -0700, Andrew Morton wrote: > On Thu, 12 Jul 2018 17:09:34 -0700 Omar Sandoval wrote: > > > From: Omar Sandoval > > > > Now we only need kclist_lock from user context and at fs init time, and > > the following chang

Re: [PATCH v2 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 07:38:41PM -0700, Andrew Morton wrote: > On Thu, 12 Jul 2018 17:09:34 -0700 Omar Sandoval wrote: > > > From: Omar Sandoval > > > > Now we only need kclist_lock from user context and at fs init time, and > > the following chang

Re: [PATCH v2 1/7] proc/kcore: don't grab lock for kclist_add()

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 07:35:04PM -0700, Andrew Morton wrote: > On Thu, 12 Jul 2018 17:09:33 -0700 Omar Sandoval wrote: > > > From: Omar Sandoval > > > > kclist_add() is only called at init time, so there's no point in > > grabbing any locks. We're al

Re: [PATCH v2 1/7] proc/kcore: don't grab lock for kclist_add()

2018-07-17 Thread Omar Sandoval
On Tue, Jul 17, 2018 at 07:35:04PM -0700, Andrew Morton wrote: > On Thu, 12 Jul 2018 17:09:33 -0700 Omar Sandoval wrote: > > > From: Omar Sandoval > > > > kclist_add() is only called at init time, so there's no point in > > grabbing any locks. We're al

[PATCH v2 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions

[PATCH v2 5/7] proc/kcore: clean up ELF header generation

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Currently, the ELF file header, program headers, and note segment are allocated all at once, in some icky code dating back to 2.3. Programs tend to read the file header, then the program headers, then the note segment, all separately, so this is a waste of effort. It's

[PATCH v2 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions

[PATCH v2 5/7] proc/kcore: clean up ELF header generation

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Currently, the ELF file header, program headers, and note segment are allocated all at once, in some icky code dating back to 2.3. Programs tend to read the file header, then the program headers, then the note segment, all separately, so this is a waste of effort. It's

[PATCH v2 4/7] proc/kcore: hold lock during read

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 70 - 1 file changed

[PATCH v2 1/7] proc/kcore: don't grab lock for kclist_add()

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 3 +-- 1 file changed, 1

[PATCH v2 4/7] proc/kcore: hold lock during read

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 70 - 1 file changed

[PATCH v2 1/7] proc/kcore: don't grab lock for kclist_add()

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 3 +-- 1 file changed, 1

[PATCH v2 6/7] proc/kcore: optimize multiple page reads

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval The current code does a full search of the segment list every time for every page. This is wasteful, since it's almost certain that the next page will be in the same segment. Instead, check if the previous segment covers the current page before doing the list search. Signed

[PATCH v2 6/7] proc/kcore: optimize multiple page reads

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval The current code does a full search of the segment list every time for every page. This is wasteful, since it's almost certain that the next page will be in the same segment. Instead, check if the previous segment covers the current page before doing the list search. Signed

[PATCH v2 7/7] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient. Signed-off-by: Omar Sandoval --- fs/proc/Kconfig| 1 + fs/proc/kcore.c

[PATCH v2 7/7] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient. Signed-off-by: Omar Sandoval --- fs/proc/Kconfig| 1 + fs/proc/kcore.c

[PATCH v2 3/7] proc/kcore: fix memory hotplug vs multiple opens race

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram

[PATCH v2 0/7] /proc/kcore improvements

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. Patches 1 and 2 are prep patches. Patch 3 is a fix/cleanup. Patch 4 is another prep patch. Patches 5 and 6 are optimizations to ->read(). Patch 7 adds vmcoreinfo to /proc/kcore (apparently I'm not the only one

[PATCH v2 3/7] proc/kcore: fix memory hotplug vs multiple opens race

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram

[PATCH v2 0/7] /proc/kcore improvements

2018-07-12 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. Patches 1 and 2 are prep patches. Patch 3 is a fix/cleanup. Patch 4 is another prep patch. Patches 5 and 6 are optimizations to ->read(). Patch 7 adds vmcoreinfo to /proc/kcore (apparently I'm not the only one

Re: [PATCH 5/7] proc/kcore: clean up ELF header generation

2018-07-07 Thread Omar Sandoval
rong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Omar-Sandoval/proc-kcore-improvements/20180707-052548 > reproduce: > # apt-get install sparse > make ARCH=x86_64 allmodconfig >

Re: [PATCH 5/7] proc/kcore: clean up ELF header generation

2018-07-07 Thread Omar Sandoval
rong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Omar-Sandoval/proc-kcore-improvements/20180707-052548 > reproduce: > # apt-get install sparse > make ARCH=x86_64 allmodconfig >

[PATCH 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions

[PATCH 1/7] proc/kcore: don't grab lock for kclist_add()

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 3 +-- 1 file changed, 1

[PATCH 0/7] /proc/kcore improvements

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. Patches 1 and 2 are prep patches. Patch 3 is a fix/cleanup. Patch 4 is another prep patch. Patches 5 and 6 are optimizations to ->read(). Patch 7 adds vmcoreinfo to /proc/kcore. This series is based on v4.18-

[PATCH 2/7] proc/kcore: replace kclist_lock rwlock with rwsem

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions

[PATCH 1/7] proc/kcore: don't grab lock for kclist_add()

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 3 +-- 1 file changed, 1

[PATCH 0/7] /proc/kcore improvements

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval Hi, This series makes a few improvements to /proc/kcore. Patches 1 and 2 are prep patches. Patch 3 is a fix/cleanup. Patch 4 is another prep patch. Patches 5 and 6 are optimizations to ->read(). Patch 7 adds vmcoreinfo to /proc/kcore. This series is based on v4.18-

[PATCH 3/7] proc/kcore: fix memory hotplug vs multiple opens race

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram

[PATCH 7/7] proc/kcore: add vmcoreinfo note to /proc/kcore

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient. Signed-off-by: Omar Sandoval --- fs/proc/Kconfig| 1 + fs/proc/kcore.c

[PATCH 4/7] proc/kcore: hold lock during read

2018-07-06 Thread Omar Sandoval
From: Omar Sandoval Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. Signed-off-by: Omar Sandoval --- fs/proc/kcore.c | 70 - 1 file changed

  1   2   3   4   5   6   7   8   >