Re: [PATCH v2] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-20 Thread NeilBrown
On Sat, Apr 21 2018, Boris Brezillon wrote: > On Sat, 21 Apr 2018 07:28:19 +1000 > NeilBrown <n...@brown.name> wrote: > >> On Fri, Apr 20 2018, Boris Brezillon wrote: >> >> > Hi Neil, >> > >> > On Mon, 16 Apr 2018 09:42:30 +1000 >> &

Re: [PATCH v2] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-20 Thread NeilBrown
On Sat, Apr 21 2018, Boris Brezillon wrote: > On Sat, 21 Apr 2018 07:28:19 +1000 > NeilBrown wrote: > >> On Fri, Apr 20 2018, Boris Brezillon wrote: >> >> > Hi Neil, >> > >> > On Mon, 16 Apr 2018 09:42:30 +1000 >> > NeilBrown wrote

Re: [PATCH v2] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-20 Thread NeilBrown
On Fri, Apr 20 2018, Boris Brezillon wrote: > Hi Neil, > > On Mon, 16 Apr 2018 09:42:30 +1000 > NeilBrown <n...@brown.name> wrote: > >> Winbond spi-nor flash 32MB and larger have an 'Extended Address >> Register' as one option for addressing beyond 16MB (Macronix

Re: [PATCH v2] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-20 Thread NeilBrown
On Fri, Apr 20 2018, Boris Brezillon wrote: > Hi Neil, > > On Mon, 16 Apr 2018 09:42:30 +1000 > NeilBrown wrote: > >> Winbond spi-nor flash 32MB and larger have an 'Extended Address >> Register' as one option for addressing beyond 16MB (Macronix >> has the same

[PATCH v3] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-20 Thread NeilBrown
") Cc: sta...@vger.kernel.org (v4.16) Signed-off-by: NeilBrown <n...@brown.name> --- drivers/mtd/spi-nor/spi-nor.c | 14 ++ include/linux/mtd/spi-nor.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c in

[PATCH v3] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-20 Thread NeilBrown
") Cc: sta...@vger.kernel.org (v4.16) Signed-off-by: NeilBrown --- drivers/mtd/spi-nor/spi-nor.c | 14 ++ include/linux/mtd/spi-nor.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 5bfa36e95f35..42ae9a152

Re: [patch V2 7/8] dm verity fec: Check result of init_rs()

2018-04-19 Thread NeilBrown
fec_rs_free, (void *) v); > > static void *fec_rs_alloc(gfp_t gfp_mask, void *pool_data) > { > struct dm_verity *v = (struct dm_verity *)pool_data; > > return init_rs(8, 0x11d, 0, 1, v->fec->roots); > } > > So init_rs() is part of the chain, rig

Re: [patch V2 7/8] dm verity fec: Check result of init_rs()

2018-04-19 Thread NeilBrown
ic void *fec_rs_alloc(gfp_t gfp_mask, void *pool_data) > { > struct dm_verity *v = (struct dm_verity *)pool_data; > > return init_rs(8, 0x11d, 0, 1, v->fec->roots); > } > > So init_rs() is part of the chain, right? > > Yes. I missed the NOIO part. But

Re: [PATCH 1/6] rhashtable: remove outdated comments about grow_decision etc

2018-04-18 Thread NeilBrown
On Wed, Apr 18 2018, Herbert Xu wrote: > On Wed, Apr 18, 2018 at 04:47:01PM +1000, NeilBrown wrote: >> grow_decision and shink_decision no longer exist, so remove >> the remaining references to them. >> >> Signed-off-by: NeilBrown <ne...@suse.com&g

Re: [PATCH 1/6] rhashtable: remove outdated comments about grow_decision etc

2018-04-18 Thread NeilBrown
On Wed, Apr 18 2018, Herbert Xu wrote: > On Wed, Apr 18, 2018 at 04:47:01PM +1000, NeilBrown wrote: >> grow_decision and shink_decision no longer exist, so remove >> the remaining references to them. >> >> Signed-off-by: NeilBrown > > Acked-by: Herbert Xu

Re: [PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-18 Thread NeilBrown
On Wed, Apr 18 2018, Herbert Xu wrote: > On Wed, Apr 18, 2018 at 04:47:02PM +1000, NeilBrown wrote: >> rhashtable_walk_prev() returns the object returned by >> the previous rhashtable_walk_next(), providing it is still in the >> table (or was during this grace period

Re: [PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-18 Thread NeilBrown
On Wed, Apr 18 2018, Herbert Xu wrote: > On Wed, Apr 18, 2018 at 04:47:02PM +1000, NeilBrown wrote: >> rhashtable_walk_prev() returns the object returned by >> the previous rhashtable_walk_next(), providing it is still in the >> table (or was during this grace period

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread NeilBrown
On Wed, Apr 18 2018, Herbert Xu wrote: > On Wed, Apr 18, 2018 at 04:47:01PM +1000, NeilBrown wrote: >> Neither rhashtable_walk_enter() or rhltable_walk_enter() sleep, so >> remove the comments which suggest that they do. >> >> Signed-off-by: NeilBrown <ne...@suse

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread NeilBrown
On Wed, Apr 18 2018, Herbert Xu wrote: > On Wed, Apr 18, 2018 at 04:47:01PM +1000, NeilBrown wrote: >> Neither rhashtable_walk_enter() or rhltable_walk_enter() sleep, so >> remove the comments which suggest that they do. >> >> Signed-off-by: NeilBrown >> -

Re: [cfs_trace_lock_tcd] BUG: KASAN: null-ptr-deref in cfs_trace_lock_tcd+0x25/0xeb

2018-04-18 Thread NeilBrown
ahkbtvrq@inn> Thanks, NeilBrown > > Anyway, I started looking at why the stack trace is such an incredible > mess, with lots of stale entries. > > The reason (well, _one_ reason) seems to be "ksocknal_startup". It has > a 500-byte stack frame for some incomprehensible r

Re: [cfs_trace_lock_tcd] BUG: KASAN: null-ptr-deref in cfs_trace_lock_tcd+0x25/0xeb

2018-04-18 Thread NeilBrown
ahkbtvrq@inn> Thanks, NeilBrown > > Anyway, I started looking at why the stack trace is such an incredible > mess, with lots of stale entries. > > The reason (well, _one_ reason) seems to be "ksocknal_startup". It has > a 500-byte stack frame for some incomprehensible r

[PATCH 4/6] rhashtable: improve rhashtable_walk stability when stop/start used.

2018-04-18 Thread NeilBrown
ugh it is still in the hashtable if a rehash has moved it to a new table. In this case it will (eventually) get -EAGAIN and will need to proceed through the whole table again to be sure to see everything at least once. Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Signed-off-by: Neil

[PATCH 4/6] rhashtable: improve rhashtable_walk stability when stop/start used.

2018-04-18 Thread NeilBrown
ugh it is still in the hashtable if a rehash has moved it to a new table. In this case it will (eventually) get -EAGAIN and will need to proceed through the whole table again to be sure to see everything at least once. Acked-by: Herbert Xu Signed-off-by: NeilBrown --- lib/rhashtable.c |

[PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-18 Thread NeilBrown
ablish the current location in the table. If it returns NULL, then rhashtable_walk_next() should be used. Signed-off-by: NeilBrown <ne...@suse.com> --- include/linux/rhashtable.h |1 + lib/rhashtable.c | 30 ++ 2 files changed, 31 insertions(+) diff --g

[PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-18 Thread NeilBrown
ablish the current location in the table. If it returns NULL, then rhashtable_walk_next() should be used. Signed-off-by: NeilBrown --- include/linux/rhashtable.h |1 + lib/rhashtable.c | 30 ++ 2 files changed, 31 insertions(+) diff --git a/include

[PATCH 5/6] rhashtable: further improve stability of rhashtable_walk

2018-04-18 Thread NeilBrown
ble_walk_next() is called while p is not NULL and not safe, it walks the chain looking for the first object with an address greater than p and returns that. If there is none, it moves to the next hash chain. Signed-off-by: NeilBrown <ne...@suse.com> --- include/linux/rhashtable.h |

[PATCH 5/6] rhashtable: further improve stability of rhashtable_walk

2018-04-18 Thread NeilBrown
ble_walk_next() is called while p is not NULL and not safe, it walks the chain looking for the first object with an address greater than p and returns that. If there is none, it moves to the next hash chain. Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 12 ++-- lib

[PATCH 1/6] rhashtable: remove outdated comments about grow_decision etc

2018-04-18 Thread NeilBrown
grow_decision and shink_decision no longer exist, so remove the remaining references to them. Signed-off-by: NeilBrown <ne...@suse.com> --- include/linux/rhashtable.h | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/include

[PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread NeilBrown
Neither rhashtable_walk_enter() or rhltable_walk_enter() sleep, so remove the comments which suggest that they do. Signed-off-by: NeilBrown <ne...@suse.com> --- include/linux/rhashtable.h |3 --- lib/rhashtable.c |3 --- 2 files changed, 6 deletions(-) diff --git a/i

[PATCH 3/6] rhashtable: reset iter when rhashtable_walk_start sees new table

2018-04-18 Thread NeilBrown
; Signed-off-by: NeilBrown <ne...@suse.com> --- lib/rhashtable.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 19db8e563c40..28e1be9f681b 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -733,6 +733,8 @@ int rhashtable_walk_start_check(stru

[PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread NeilBrown
Neither rhashtable_walk_enter() or rhltable_walk_enter() sleep, so remove the comments which suggest that they do. Signed-off-by: NeilBrown --- include/linux/rhashtable.h |3 --- lib/rhashtable.c |3 --- 2 files changed, 6 deletions(-) diff --git a/include/linux/rhashtable.h

[PATCH 3/6] rhashtable: reset iter when rhashtable_walk_start sees new table

2018-04-18 Thread NeilBrown
The documentation claims that when rhashtable_walk_start_check() detects a resize event, it will rewind back to the beginning of the table. This is not true. We need to set ->slot and ->skip to be zero for it to be true. Acked-by: Herbert Xu Signed-off-by: NeilBrown --- lib/rhasht

[PATCH 1/6] rhashtable: remove outdated comments about grow_decision etc

2018-04-18 Thread NeilBrown
grow_decision and shink_decision no longer exist, so remove the remaining references to them. Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/include/linux/rhashtable.h b/include

[PATCH 0/6] Assorted rhashtable improvements. RESEND

2018-04-18 Thread NeilBrown
be good for some of these patches to go upstream through 'staging' with the lustre patches. I no longer think that is necessary. It is probably best for them to go upstream through net or net-next. Thanks, NeilBrown --- NeilBrown (6): rhashtable: remove outdated comments about

[PATCH 0/6] Assorted rhashtable improvements. RESEND

2018-04-18 Thread NeilBrown
be good for some of these patches to go upstream through 'staging' with the lustre patches. I no longer think that is necessary. It is probably best for them to go upstream through net or net-next. Thanks, NeilBrown --- NeilBrown (6): rhashtable: remove outdated comments about

Re: [PATCH 00/20] staging: lustre: convert to rhashtable

2018-04-17 Thread NeilBrown
n case of inserting in an empty chain, a single atomic cmpxchg() should be sufficient I think we have a better chance of being heard if we have "skin in the game" and have upstream code that would use this. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH 00/20] staging: lustre: convert to rhashtable

2018-04-17 Thread NeilBrown
n case of inserting in an empty chain, a single atomic cmpxchg() should be sufficient I think we have a better chance of being heard if we have "skin in the game" and have upstream code that would use this. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH 3/6] staging: lustre: remove include/linux/libcfs/linux/linux-cpu.h

2018-04-17 Thread NeilBrown
ce > the rc1 stuff but since their is a push to get everything out their I will > push it. > Great - thanks for posting those. I might wait until they land in Greg's tree, then see if I there is anything else I want to add. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH 3/6] staging: lustre: remove include/linux/libcfs/linux/linux-cpu.h

2018-04-17 Thread NeilBrown
ce > the rc1 stuff but since their is a push to get everything out their I will > push it. > Great - thanks for posting those. I might wait until they land in Greg's tree, then see if I there is anything else I want to add. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH 2/6] staging: lustre: remove libcfs/linux/libcfs.h

2018-04-17 Thread NeilBrown
ent paths to get there. If you have something nearly ready to submit, I'm happy to wait for it, then proceed on top of it. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH 2/6] staging: lustre: remove libcfs/linux/libcfs.h

2018-04-17 Thread NeilBrown
ent paths to get there. If you have something nearly ready to submit, I'm happy to wait for it, then proceed on top of it. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [lustre-devel] [PATCH 1/6] staging: lustre: move stack-check macros to libcfs_debug.h

2018-04-17 Thread NeilBrown
I don't like the idea of have two parallel debuging infrastructures that you can choose between - it encourages confusion and brings no benefits. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [lustre-devel] [PATCH 1/6] staging: lustre: move stack-check macros to libcfs_debug.h

2018-04-17 Thread NeilBrown
I don't like the idea of have two parallel debuging infrastructures that you can choose between - it encourages confusion and brings no benefits. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH 1/6] staging: lustre: move stack-check macros to libcfs_debug.h

2018-04-17 Thread NeilBrown
a bit later in the file? That can easily be done when it is needed. It isn't needed now so why insist on it? Each patch should do one thing and make clear forward progress. This patch gets rid of an unnecessary file and brings related code together. I think that qualifies. Thanks, NeilBrown

Re: [PATCH 1/6] staging: lustre: move stack-check macros to libcfs_debug.h

2018-04-17 Thread NeilBrown
a bit later in the file? That can easily be done when it is needed. It isn't needed now so why insist on it? Each patch should do one thing and make clear forward progress. This patch gets rid of an unnecessary file and brings related code together. I think that qualifies. Thanks, NeilBrown

[PATCH 6/6] staging: lustre: move remaining code from linux-module.c to module.c

2018-04-15 Thread NeilBrown
There is no longer any need to keep this code separate, and now we can remove linux-module.c Signed-off-by: NeilBrown <ne...@suse.com> --- .../staging/lustre/include/linux/libcfs/libcfs.h |4 drivers/staging/lustre/lnet/libcfs/Makefile|1 .../lustre/lnet/libcfs/linux

[PATCH 6/6] staging: lustre: move remaining code from linux-module.c to module.c

2018-04-15 Thread NeilBrown
There is no longer any need to keep this code separate, and now we can remove linux-module.c Signed-off-by: NeilBrown --- .../staging/lustre/include/linux/libcfs/libcfs.h |4 drivers/staging/lustre/lnet/libcfs/Makefile|1 .../lustre/lnet/libcfs/linux/linux-module.c

[PATCH 5/6] staging: lustre: move misc-device registration closer to related code.

2018-04-15 Thread NeilBrown
The ioctl handler for the misc device is in lnet/libcfs/module.c but is it registered in lnet/libcfs/linux/linux-module.c. Keeping related code together make maintenance easier, so move the code. Signed-off-by: NeilBrown <ne...@suse.com> --- .../staging/lustre/include/linux/libcfs/li

[PATCH 5/6] staging: lustre: move misc-device registration closer to related code.

2018-04-15 Thread NeilBrown
The ioctl handler for the misc device is in lnet/libcfs/module.c but is it registered in lnet/libcfs/linux/linux-module.c. Keeping related code together make maintenance easier, so move the code. Signed-off-by: NeilBrown --- .../staging/lustre/include/linux/libcfs/libcfs.h |2

[PATCH 1/6] staging: lustre: move stack-check macros to libcfs_debug.h

2018-04-15 Thread NeilBrown
and simplifying the include file structure. Signed-off-by: NeilBrown <ne...@suse.com> --- .../lustre/include/linux/libcfs/libcfs_debug.h | 32 .../lustre/include/linux/libcfs/linux/libcfs.h | 31 --- 2 files changed, 32 insertions(+), 31 del

[PATCH 1/6] staging: lustre: move stack-check macros to libcfs_debug.h

2018-04-15 Thread NeilBrown
and simplifying the include file structure. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/libcfs_debug.h | 32 .../lustre/include/linux/libcfs/linux/libcfs.h | 31 --- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git

[PATCH 4/6] staging: lustre: rearrange placement of CPU partition management code.

2018-04-15 Thread NeilBrown
code movement. Signed-off-by: NeilBrown <ne...@suse.com> --- .../lustre/include/linux/libcfs/libcfs_cpu.h | 173 +++ drivers/staging/lustre/lnet/libcfs/Makefile|1 drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c| 959 +- .../staging/lustre/lnet/

[PATCH 4/6] staging: lustre: rearrange placement of CPU partition management code.

2018-04-15 Thread NeilBrown
code movement. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/libcfs_cpu.h | 173 +++ drivers/staging/lustre/lnet/libcfs/Makefile|1 drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c| 959 +- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c

[PATCH 0/6] staging: lustre: code rearrangement

2018-04-15 Thread NeilBrown
se dynamic minors for /dev/{lnet,obd} which James posted on 30th March. Thanks, NeilBrown --- NeilBrown (6): staging: lustre: move stack-check macros to libcfs_debug.h staging: lustre: remove libcfs/linux/libcfs.h staging: lustre: remove include/linux/libcfs/linux/linux-cpu.h

[PATCH 2/6] staging: lustre: remove libcfs/linux/libcfs.h

2018-04-15 Thread NeilBrown
Probably many of these should be remove from here, and moved to just the files that need them. Signed-off-by: NeilBrown <ne...@suse.com> --- .../staging/lustre/include/linux/libcfs/libcfs.h | 43 ++ .../lustre/include/linux/libcfs/linux/libcfs.h | 83

[PATCH 3/6] staging: lustre: remove include/linux/libcfs/linux/linux-cpu.h

2018-04-15 Thread NeilBrown
This include file contains definitions used when CONFIG_SMP is in effect. Other includes contain corresponding definitions for when it isn't. This can be hard to follow, so move the definitions to the one place. As HAVE_LIBCFS_CPT is defined precisely when CONFIG_SMP, we discard that macro and

[PATCH 0/6] staging: lustre: code rearrangement

2018-04-15 Thread NeilBrown
se dynamic minors for /dev/{lnet,obd} which James posted on 30th March. Thanks, NeilBrown --- NeilBrown (6): staging: lustre: move stack-check macros to libcfs_debug.h staging: lustre: remove libcfs/linux/libcfs.h staging: lustre: remove include/linux/libcfs/linux/linux-cpu.h

[PATCH 2/6] staging: lustre: remove libcfs/linux/libcfs.h

2018-04-15 Thread NeilBrown
Probably many of these should be remove from here, and moved to just the files that need them. Signed-off-by: NeilBrown --- .../staging/lustre/include/linux/libcfs/libcfs.h | 43 ++ .../lustre/include/linux/libcfs/linux/libcfs.h | 83 2 files changed, 42

[PATCH 3/6] staging: lustre: remove include/linux/libcfs/linux/linux-cpu.h

2018-04-15 Thread NeilBrown
This include file contains definitions used when CONFIG_SMP is in effect. Other includes contain corresponding definitions for when it isn't. This can be hard to follow, so move the definitions to the one place. As HAVE_LIBCFS_CPT is defined precisely when CONFIG_SMP, we discard that macro and

[PATCH v2] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-15 Thread NeilBrown
-by: NeilBrown <n...@brown.name> --- following a helpful discussion with Marek, I've revised the description a little, and make the code change specific to winbond. I've change the OP names to RDEAR and WREAR instead of RDXA and WRXA to match names used in the Macronix documentation. W

[PATCH v2] mtd: spi-nor: clear Winbond Extended Address Reg on switch to 3-byte addressing.

2018-04-15 Thread NeilBrown
-by: NeilBrown --- following a helpful discussion with Marek, I've revised the description a little, and make the code change specific to winbond. I've change the OP names to RDEAR and WREAR instead of RDXA and WRXA to match names used in the Macronix documentation. Winbond documentation doesn't

[PATCH] VFS: simplify seq_file iteration code and interface

2018-04-15 Thread NeilBrown
t such ->next functions are buggy and should be fixed. A simple demonstration is dd if=/proc/swaps bs=1000 skip=1 Choose any block size larger than the size of /proc/swaps. This will always show the whole last line of /proc/swaps. This patch doesn't work around buggy next() functions for this c

[PATCH] VFS: simplify seq_file iteration code and interface

2018-04-15 Thread NeilBrown
t such ->next functions are buggy and should be fixed. A simple demonstration is dd if=/proc/swaps bs=1000 skip=1 Choose any block size larger than the size of /proc/swaps. This will always show the whole last line of /proc/swaps. This patch doesn't work around buggy next() functions for th

[PATCH 20/20] staging: lustre: remove cfs_hash resizeable hashtable implementation.

2018-04-11 Thread NeilBrown
All users of this library have been converted to use rhashtable. Signed-off-by: NeilBrown <ne...@suse.com> --- .../staging/lustre/include/linux/libcfs/libcfs.h |1 .../lustre/include/linux/libcfs/libcfs_hash.h | 866 drivers/staging/lustre/lnet/libcfs/Makefile

[PATCH 20/20] staging: lustre: remove cfs_hash resizeable hashtable implementation.

2018-04-11 Thread NeilBrown
All users of this library have been converted to use rhashtable. Signed-off-by: NeilBrown --- .../staging/lustre/include/linux/libcfs/libcfs.h |1 .../lustre/include/linux/libcfs/libcfs_hash.h | 866 drivers/staging/lustre/lnet/libcfs/Makefile|2 drivers

[PATCH 19/20] staging: lustre: convert lu_object cache to rhashtable

2018-04-11 Thread NeilBrown
with a refcount of zero while holding the lsb_marche_funebre.lock. As there is nothing to stop us using the resizing capabilities of rhashtable, the code to try to guess the perfect has size has been removed. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lu_ob

[PATCH 19/20] staging: lustre: convert lu_object cache to rhashtable

2018-04-11 Thread NeilBrown
with a refcount of zero while holding the lsb_marche_funebre.lock. As there is nothing to stop us using the resizing capabilities of rhashtable, the code to try to guess the perfect has size has been removed. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lu_object.h |8

[PATCH 18/20] staging: lustre: change how "dump_page_cache" walks a hash table

2018-04-11 Thread NeilBrown
find it again (and possibly fail) for each page. And the ->start and ->next functions are changed as described above. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 173 +++-- 1 file changed, 79 insertions(+), 94 d

[PATCH 18/20] staging: lustre: change how "dump_page_cache" walks a hash table

2018-04-11 Thread NeilBrown
find it again (and possibly fail) for each page. And the ->start and ->next functions are changed as described above. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 173 +++-- 1 file changed, 79 insertions(+), 94 deletions(-) diff --git a

[PATCH 17/20] staging: lustre: use call_rcu() to free lu_object_headers

2018-04-11 Thread NeilBrown
Using call_rcu to free lu_object_headers will allow us to use rhashtable and get lockless lookup. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lu_object.h |6 +- drivers/staging/lustre/lustre/llite/vvp_object.c |9 - drivers/s

[PATCH 16/20] staging: lustre: llite: remove redundant lookup in dump_pgcache

2018-04-11 Thread NeilBrown
, and finds the clob where it was stored. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 97 +++-- 1 file changed, 41 insertions(+), 56 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/s

[PATCH 16/20] staging: lustre: llite: remove redundant lookup in dump_pgcache

2018-04-11 Thread NeilBrown
, and finds the clob where it was stored. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 97 +++-- 1 file changed, 41 insertions(+), 56 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/l

[PATCH 17/20] staging: lustre: use call_rcu() to free lu_object_headers

2018-04-11 Thread NeilBrown
Using call_rcu to free lu_object_headers will allow us to use rhashtable and get lockless lookup. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lu_object.h |6 +- drivers/staging/lustre/lustre/llite/vvp_object.c |9 - drivers/staging/lustre/lustre/lov

[PATCH 13/20] staging: lustre: lu_object: move retry logic inside htable_lookup

2018-04-11 Thread NeilBrown
this a 'goto' loop rather than a 'while(1)' loop as the diff is easier to read. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 73 +++- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/drivers/staging/lustre/

[PATCH 13/20] staging: lustre: lu_object: move retry logic inside htable_lookup

2018-04-11 Thread NeilBrown
this a 'goto' loop rather than a 'while(1)' loop as the diff is easier to read. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 73 +++- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass

[PATCH 15/20] staging: lustre: llite: use more private data in dump_pgcache

2018-04-11 Thread NeilBrown
'seq_private' structure which stores the sbi, env, and refcheck, and attach this to the seqfile. Then use it throughout instead of allocating 'env' repeatedly. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 150 - 1 file chang

[PATCH 14/20] staging: lustre: fold lu_object_new() into lu_object_find_at()

2018-04-11 Thread NeilBrown
lu_object_new() duplicates a lot of code that is in lu_object_find_at(). There is no real need for a separate function, it is simpler just to skip the bits of lu_object_find_at() that we don't want in the LOC_F_NEW case. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/

[PATCH 14/20] staging: lustre: fold lu_object_new() into lu_object_find_at()

2018-04-11 Thread NeilBrown
lu_object_new() duplicates a lot of code that is in lu_object_find_at(). There is no real need for a separate function, it is simpler just to skip the bits of lu_object_find_at() that we don't want in the LOC_F_NEW case. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass

[PATCH 15/20] staging: lustre: llite: use more private data in dump_pgcache

2018-04-11 Thread NeilBrown
'seq_private' structure which stores the sbi, env, and refcheck, and attach this to the seqfile. Then use it throughout instead of allocating 'env' repeatedly. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 150 - 1 file changed, 72 insertions

[PATCH 11/20] staging: lustre: lu_object: discard extra lru count.

2018-04-11 Thread NeilBrown
is not essential, and the per-cpu counter can be used to get the combined total. So discard the per-bucket lsb_lru_len. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 24 1 file changed, 9 insertions(+), 15 deletions(-) diff

[PATCH 11/20] staging: lustre: lu_object: discard extra lru count.

2018-04-11 Thread NeilBrown
is not essential, and the per-cpu counter can be used to get the combined total. So discard the per-bucket lsb_lru_len. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 24 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/staging

[PATCH 10/20] staging: lustre: make struct lu_site_bkt_data private

2018-04-11 Thread NeilBrown
This data structure only needs to be public so that various modules can access a wait queue to wait for object destruction. If we provide a function to get the wait queue, rather than the whole bucket, the structure can be made private. Signed-off-by: NeilBrown <ne...@suse.com> --- d

[PATCH 06/20] staging: lustre: ldlm: add a counter to the per-namespace data

2018-04-11 Thread NeilBrown
. Having a counter we control makes it easier to manage the back-reference to the namespace when there is anything in the hash table. So add a counter to the ldlm_ns_bucket. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lustre_dlm.h |2 ++ drivers/s

[PATCH 10/20] staging: lustre: make struct lu_site_bkt_data private

2018-04-11 Thread NeilBrown
This data structure only needs to be public so that various modules can access a wait queue to wait for object destruction. If we provide a function to get the wait queue, rather than the whole bucket, the structure can be made private. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre

[PATCH 06/20] staging: lustre: ldlm: add a counter to the per-namespace data

2018-04-11 Thread NeilBrown
. Having a counter we control makes it easier to manage the back-reference to the namespace when there is anything in the hash table. So add a counter to the ldlm_ns_bucket. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_dlm.h |2 ++ drivers/staging/lustre/lustre

[PATCH 09/20] staging: lustre: convert ldlm_resource hash to rhashtable.

2018-04-11 Thread NeilBrown
-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 10 + drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 31 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 268 +--- drivers/staging/lustre/lustre/osc/osc_request.c

[PATCH 08/20] staging: lustre: simplify ldlm_ns_hash_defs[]

2018-04-11 Thread NeilBrown
As the ldlm_ns_types are dense, we can use the type as the index to the array, rather than searching through the array for a match. We can also discard nsd_hops as all hash tables now use the same hops. This makes the table smaller and the code simpler. Signed-off-by: NeilBrown <ne...@suse.

[PATCH 09/20] staging: lustre: convert ldlm_resource hash to rhashtable.

2018-04-11 Thread NeilBrown
-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 10 + drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 31 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 268 +--- drivers/staging/lustre/lustre/osc/osc_request.c| 12 - 4 files

[PATCH 08/20] staging: lustre: simplify ldlm_ns_hash_defs[]

2018-04-11 Thread NeilBrown
As the ldlm_ns_types are dense, we can use the type as the index to the array, rather than searching through the array for a match. We can also discard nsd_hops as all hash tables now use the same hops. This makes the table smaller and the code simpler. Signed-off-by: NeilBrown --- drivers

[PATCH 07/20] staging: lustre: ldlm: store name directly in namespace.

2018-04-11 Thread NeilBrown
Rather than storing the name of a namespace in the hash table, store it directly in the namespace. This will allow the hashtable to be changed to use rhashtable. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lustre_dlm.h |5 - drivers/staging/

[PATCH 12/20] staging: lustre: lu_object: factor out extra per-bucket data

2018-04-11 Thread NeilBrown
When the hashtable becomes resizeable, those statistics will be irrelevant. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lu_object.h |5 + drivers/staging/lustre/lustre/obdclass/lu_object.c | 135 +++- 2 files changed, 77 inserti

[PATCH 07/20] staging: lustre: ldlm: store name directly in namespace.

2018-04-11 Thread NeilBrown
Rather than storing the name of a namespace in the hash table, store it directly in the namespace. This will allow the hashtable to be changed to use rhashtable. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_dlm.h |5 - drivers/staging/lustre/lustre/ldlm

[PATCH 12/20] staging: lustre: lu_object: factor out extra per-bucket data

2018-04-11 Thread NeilBrown
When the hashtable becomes resizeable, those statistics will be irrelevant. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lu_object.h |5 + drivers/staging/lustre/lustre/obdclass/lu_object.c | 135 +++- 2 files changed, 77 insertions(+), 63 deletions(-) diff -

[PATCH 05/20] staging: lustre: separate buckets from ldlm hash table

2018-04-11 Thread NeilBrown
. This results in zero bits being used to choose a bucket - so there is only one bucket. This looks odd and would confuse hash_32(), so I've adjusted the numbers so there is always at least 1 bit (2 buckets). Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/i

[PATCH 05/20] staging: lustre: separate buckets from ldlm hash table

2018-04-11 Thread NeilBrown
. This results in zero bits being used to choose a bucket - so there is only one bucket. This looks odd and would confuse hash_32(), so I've adjusted the numbers so there is always at least 1 bit (2 buckets). Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_dlm.h |2

[PATCH 02/20] staging: lustre: convert lov_pool to use rhashtable

2018-04-11 Thread NeilBrown
and if that fails, we must have raced with a deletion, so we treat the lookup as a failure. Use hashlen_string() rather than a hand-crafted hash function. Note that the pool_name, and the search key, are guaranteed to be nul terminated. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/s

[PATCH 04/20] staging: lustre: convert osc_quota hash to rhashtable

2018-04-11 Thread NeilBrown
with another thread performing a removal. This means we need to use call_rcu() to free the quota info so we need an rcu_head in there, which unfortunately doubles the size of the structure. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/obd.h

[PATCH 02/20] staging: lustre: convert lov_pool to use rhashtable

2018-04-11 Thread NeilBrown
and if that fails, we must have raced with a deletion, so we treat the lookup as a failure. Use hashlen_string() rather than a hand-crafted hash function. Note that the pool_name, and the search key, are guaranteed to be nul terminated. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre

[PATCH 04/20] staging: lustre: convert osc_quota hash to rhashtable

2018-04-11 Thread NeilBrown
with another thread performing a removal. This means we need to use call_rcu() to free the quota info so we need an rcu_head in there, which unfortunately doubles the size of the structure. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/obd.h |2 drivers/staging

[PATCH 01/20] staging: lustre: ptlrpc: convert conn_hash to rhashtable

2018-04-11 Thread NeilBrown
to count the reference in the hash table. There is also no need to enable automatic_shrinking. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lustre_net.h |4 .../staging/lustre/lustre/include/obd_support.h|3 drivers/staging/lustre/lustre/

[PATCH 01/20] staging: lustre: ptlrpc: convert conn_hash to rhashtable

2018-04-11 Thread NeilBrown
to count the reference in the hash table. There is also no need to enable automatic_shrinking. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_net.h |4 .../staging/lustre/lustre/include/obd_support.h|3 drivers/staging/lustre/lustre/ptlrpc/connection.c

[PATCH 03/20] staging: lustre: convert obd uuid hash to rhashtable

2018-04-11 Thread NeilBrown
quite a bit. As there are no simple lookups on this hash table (only insertions which might fail and take a spinlock), there is no need to use rcu to free the exports. Signed-off-by: NeilBrown <ne...@suse.com> --- .../staging/lustre/lustre/include/lustre_export.h |2 drivers/staging/

[PATCH 00/20] staging: lustre: convert to rhashtable

2018-04-11 Thread NeilBrown
examining that code in particular would be appreciated. This series passes all the same tests that pass before the patches are applied. Thanks, NeilBrown --- NeilBrown (20): staging: lustre: ptlrpc: convert conn_hash to rhashtable staging: lustre: convert lov_pool to use rhashtable

[PATCH 03/20] staging: lustre: convert obd uuid hash to rhashtable

2018-04-11 Thread NeilBrown
quite a bit. As there are no simple lookups on this hash table (only insertions which might fail and take a spinlock), there is no need to use rcu to free the exports. Signed-off-by: NeilBrown --- .../staging/lustre/lustre/include/lustre_export.h |2 drivers/staging/lustre/lustre/include

[PATCH 00/20] staging: lustre: convert to rhashtable

2018-04-11 Thread NeilBrown
examining that code in particular would be appreciated. This series passes all the same tests that pass before the patches are applied. Thanks, NeilBrown --- NeilBrown (20): staging: lustre: ptlrpc: convert conn_hash to rhashtable staging: lustre: convert lov_pool to use rhashtable

<    5   6   7   8   9   10   11   12   13   14   >