[PATCH 1/4] fs/locks: rename some lists and pointers.

2018-08-07 Thread NeilBrown
be an ABI breakage? Signed-off-by: NeilBrown --- fs/cifs/file.c |2 +- fs/locks.c | 40 --- include/linux/fs.h |5 +++-- include/trace/events/filelock.h | 16 4 files changed, 33

[PATCH 2/4] fs/locks: allow a lock request to block other requests.

2018-08-07 Thread NeilBrown
st is removed, all blocked requests are woken. - When deadlock-detection looks for the lock which blocks a given request, we follow the chain of ->fl_blocker all the way to the top. Signed-off-by: NeilBrown --- fs/locks.c | 58 --

[PATCH 3/4] fs/locks: change all *_conflict() functions to return bool.

2018-08-07 Thread NeilBrown
convert some return (foo); to return foo; Signed-off-by: NeilBrown --- fs/locks.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index b4812da2a374..aaa55925c788 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -793,47

Re: [PATCH 1/4] lib/rhashtable: simplify bucket_table_alloc()

2018-06-21 Thread NeilBrown
change we lose __GFP_NOWARN and __GFP_NORETRY. I doubt the NORETRY is particularly important as this is if it isn't GFP_KERNEL, then it is GFP_ATOMIC which doesn't retry anyway. However I cannot see why this patch won't result in warnings when the kzalloc() fails. What am I missing? Thank

RE: [PATCH 0/4] locks: avoid thundering-herd wake-ups

2018-08-08 Thread NeilBrown
On Wed, Aug 08 2018, Frank Filz wrote: >> On Wed, Aug 08, 2018 at 03:54:45PM -0400, J. Bruce Fields wrote: >> > On Wed, Aug 08, 2018 at 11:51:07AM +1000, NeilBrown wrote: >> > > If you have a many-core machine, and have many threads all wanting >> > > to bri

Re: [PATCH 0/4] locks: avoid thundering-herd wake-ups

2018-08-08 Thread NeilBrown
On Wed, Aug 08 2018, J. Bruce Fields wrote: > On Wed, Aug 08, 2018 at 04:09:12PM -0400, J. Bruce Fields wrote: >> On Wed, Aug 08, 2018 at 03:54:45PM -0400, J. Bruce Fields wrote: >> > On Wed, Aug 08, 2018 at 11:51:07AM +1000, NeilBrown wrote: >> > > If you have a ma

Re: [PATCH 0/4] locks: avoid thundering-herd wake-ups

2018-08-08 Thread NeilBrown
On Wed, Aug 08 2018, J. Bruce Fields wrote: > On Wed, Aug 08, 2018 at 12:47:22PM -0400, Jeff Layton wrote: >> On Wed, 2018-08-08 at 11:51 +1000, NeilBrown wrote: >> > If you have a many-core machine, and have many threads all wanting to >> > briefly lock a give fil

[PATCH 0/5 - V2] locks: avoid thundering-herd wake-ups

2018-08-08 Thread NeilBrown
e lock acquisitions per second drops from 1.8 million to 1.4 million with this patch. For 100 processes, this patch still provides 1.4 million while without this patch there are about 700,000. NeilBrown --- NeilBrown (5): fs/locks: rename some lists and pointers. fs/locks: allow a lock r

[PATCH 1/5] fs/locks: rename some lists and pointers.

2018-08-08 Thread NeilBrown
be an ABI breakage? Signed-off-by: NeilBrown --- fs/cifs/file.c |2 +- fs/locks.c | 40 --- include/linux/fs.h |5 +++-- include/trace/events/filelock.h | 16 4 files changed, 33

[PATCH 2/5] fs/locks: allow a lock request to block other requests.

2018-08-08 Thread NeilBrown
st is removed, all blocked requests are woken. - When deadlock-detection looks for the lock which blocks a given request, we follow the chain of ->fl_blocker all the way to the top. Signed-off-by: NeilBrown --- fs/locks.c | 58 --

[PATCH 5/5] fs/locks: create a tree of dependent requests.

2018-08-08 Thread NeilBrown
. The rest of the herd can stay asleep. Reported-and-tested-by: Martin Wilck Signed-off-by: NeilBrown --- fs/locks.c | 69 +++- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index fc64016d01ee

[PATCH 4/5] fs/locks: split out __locks_wake_one()

2018-08-08 Thread NeilBrown
This functionality will be useful in the next patch, so split it out from __locks_wake_up_blocks(). Signed-off-by: NeilBrown --- fs/locks.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index d06658b2dc7a..fc64016d01ee 100644

[PATCH 3/5] fs/locks: change all *_conflict() functions to return a new enum.

2018-08-08 Thread NeilBrown
o current code which only tests the truth value of these functions will still work the same way. And convert some return (foo); to return foo; Signed-off-by: NeilBrown --- fs/locks.c | 64 ++-- 1 file changed, 49 insertions(+), 15 de

RE: [PATCH 0/4] locks: avoid thundering-herd wake-ups

2018-08-08 Thread NeilBrown
just a different owner. So this enhancement should work equally for posix, flock, ofd and even leases. Thanks, NeilBrown > > Frank signature.asc Description: PGP signature

Re: [PATCH 0/5 - V2] locks: avoid thundering-herd wake-ups

2018-08-09 Thread NeilBrown
in the one process - OK. Tasks 2 and 3 are threads in two other processes. So 2 and 3 conflict with either 1 or 4 equally - why should task 3 be woken? I suspect you got the numbers bit mixed up, but in any case, the "conflict()" function that is passed around takes ownership i

Re: [PATCH 5/5] fs/locks: create a tree of dependent requests.

2018-08-09 Thread NeilBrown
On Thu, Aug 09 2018, J. Bruce Fields wrote: > On Thu, Aug 09, 2018 at 12:04:41PM +1000, NeilBrown wrote: >> When we find an existing lock which conflicts with a request, >> and the request wants to wait, we currently add the request >> to a list. When the lock is removed, th

Re: [PATCH 5/5] fs/locks: create a tree of dependent requests.

2018-08-09 Thread NeilBrown
On Thu, Aug 09 2018, Jeff Layton wrote: > On Thu, 2018-08-09 at 12:04 +1000, NeilBrown wrote: >> When we find an existing lock which conflicts with a request, >> and the request wants to wait, we currently add the request >> to a list. When the lock is removed, the whole l

Re: [PATCH 3/5] fs/locks: change all *_conflict() functions to return a new enum.

2018-08-09 Thread NeilBrown
On Thu, Aug 09 2018, J. Bruce Fields wrote: > On Thu, Aug 09, 2018 at 12:04:41PM +1000, NeilBrown wrote: >> In a future patch we will need to differentiate between conflicts that >> are "transitive" and those that aren't. >> A "transitive"

Re: [PATCH 0/4] locks: avoid thundering-herd wake-ups

2018-08-09 Thread NeilBrown
oo complex, it would certainly be an option. I think the tree approach should result in less total CPU usage.. Thanks for the thought - taking this simple approach really hadn't occurred to me. :-( NeilBrown signature.asc Description: PGP signature

Re: [PATCH 0/5 - V2] locks: avoid thundering-herd wake-ups

2018-08-09 Thread NeilBrown
On Thu, Aug 09 2018, J. Bruce Fields wrote: > On Fri, Aug 10, 2018 at 08:12:43AM +1000, NeilBrown wrote: >> On Thu, Aug 09 2018, J. Bruce Fields wrote: >> >> > I think there's also a problem with multiple tasks sharing the same >> > lock owner. >> >

Re: [PATCH 0/5 - V2] locks: avoid thundering-herd wake-ups

2018-08-09 Thread NeilBrown
On Thu, Aug 09 2018, J. Bruce Fields wrote: > On Fri, Aug 10, 2018 at 11:50:58AM +1000, NeilBrown wrote: >> You're good at this game! > > Everybody's got to have a hobby, mine is pathological posix locking > cases > >> So, because a locker with the s

[PATCH 2/5] fs/locks: split out __locks_wake_up_blocks().

2018-08-13 Thread NeilBrown
This functionality will be useful in future patches, so split it out from locks_wake_up_blocks(). Signed-off-by: NeilBrown --- fs/locks.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 322491e70e41..de0b9276f23d

[PATCH 1/5] fs/locks: rename some lists and pointers.

2018-08-13 Thread NeilBrown
to report fl_blocker instead of fl_next. Signed-off-by: NeilBrown --- fs/cifs/file.c |2 +- fs/locks.c | 40 --- include/linux/fs.h |7 +-- include/trace/events/filelock.h | 16 ---

[PATCH 0/5 v2] locks: avoid thundering-herd wake-ups

2018-08-13 Thread NeilBrown
a particular test on 72 cores, the lock acquisitions per second drops from 1.8 million to 1.4 million with this patch. For 100 processes, this patch still provides 1.4 million while without this patch there are about 700,000. NeilBrown --- NeilBrown (5): fs/locks: rename some lists and

[PATCH 3/5] fs/locks: allow a lock request to block other requests.

2018-08-13 Thread NeilBrown
st is requeued or discarded, all blocked requests are woken. - When deadlock-detection looks for the lock which blocks a given request, we follow the chain of ->fl_blocker all the way to the top. Signed-off-by: NeilBrown --- fs/locks.c | 43 +++

[PATCH 5/5] fs/locks: create a tree of dependent requests.

2018-08-13 Thread NeilBrown
Wilck Signed-off-by: NeilBrown --- fs/locks.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index c7a372cebff1..af250afceff4 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -727,11 +727,25 @@ static void locks_delete_block

[PATCH 4/5] fs/locks: change all *_conflict() functions to return bool.

2018-08-13 Thread NeilBrown
convert some return (foo); to return foo; Signed-off-by: NeilBrown --- fs/locks.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 9439eebd4eb9..c7a372cebff1 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -803,47

Re: [BUG][BISECT] NFSv4 root failures after "fs/locks: allow a lock request to block other requests."

2018-08-20 Thread NeilBrown
On Thu, Aug 16 2018, NeilBrown wrote: > On Wed, Aug 15 2018, Jeff Layton wrote: > >> On Wed, 2018-08-15 at 14:28 +0200, Krzysztof Kozlowski wrote: >>> Hi, >>> >>> Bisect pointed commit ce3147990450a68b3f549088b30f087742a08b5d >>> ("fs/lock

Re: [BUG][BISECT] NFSv4 root failures after "fs/locks: allow a lock request to block other requests."

2018-08-21 Thread NeilBrown
On Tue, Aug 21 2018, Jeff Layton wrote: > On Tue, 2018-08-21 at 15:11 +1000, NeilBrown wrote: >> On Thu, Aug 16 2018, NeilBrown wrote: >> >> > On Wed, Aug 15 2018, Jeff Layton wrote: >> > >> > > On Wed, 2018-08-15 at 14:28 +0200, Krzysztof Kozlowski

Re: [PATCH] mm: shmem: Correctly annotate new inodes

2018-08-21 Thread NeilBrown
->s_type->i_mutex_key#9 --> &mm->mmap_sem --> ashmem_mutex >> >> Possible unsafe locking scenario: >> >>CPU0CPU1 >> >> lock(ashmem_mutex); >>

Re: [BUG][BISECT] NFSv4 root failures after "fs/locks: allow a lock request to block other requests."

2018-08-23 Thread NeilBrown
On Wed, Aug 22 2018, NeilBrown wrote: > > Oh dear. > nfs4_alloc_lockdata contains: > memcpy(&p->fl, fl, sizeof(p->fl)); > > so any list_heads that are valid in fl will be invalid in p->fl. > > Maybe I should initialize the relevant list_heads at the

Re: [PATCH] staging: mt7621-mmc: Use BIT macro instead of explicit shifting in board.h

2018-07-30 Thread NeilBrown
On Fri, Jul 27 2018, Nishad Kamdar wrote: > Replace explicit shifting with BIT macro in board.h. > Issue found by checkpatch. > > Signed-off-by: Nishad Kamdar Reviewed-by: NeilBrown Thanks, NeilBrown > --- > drivers/staging/mt7621-mmc/board.h | 8 > 1 file

Re: [PATCH 2/5] rhashtable: don't hold lock on first table throughout insertion.

2018-07-30 Thread NeilBrown
On Fri, Jul 27 2018, Paul E. McKenney wrote: > On Thu, Jul 26, 2018 at 08:18:15PM -0700, Paul E. McKenney wrote: >> On Fri, Jul 27, 2018 at 11:04:37AM +1000, NeilBrown wrote: >> > On Wed, Jul 25 2018, Paul E. McKenney wrote: >> > >> >> > &

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

2018-07-23 Thread NeilBrown
On Mon, Jul 23 2018, Brian Norris wrote: > Hi, > > I'm a little late to this thread, but I recently noticed (and > complained about) commit: 59b356ffd0b0 ("mtd: m25p80: restore the > status of SPI flash when exiting"). > > On Mon, Apr 9, 2018 at 6:05 PM, Neil

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

2018-07-23 Thread NeilBrown
On Mon, Jul 23 2018, Brian Norris wrote: > Hi Neil, > > On Mon, Jul 23, 2018 at 2:45 PM, NeilBrown wrote: >> On Mon, Jul 23 2018, Brian Norris wrote: >>> On Mon, Apr 9, 2018 at 6:05 PM, NeilBrown wrote: >>>> On Mon, Apr 09 2018, Marek Vasut wrote: >>&

Re: [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting

2018-07-23 Thread NeilBrown
that one has to > admit that their board design is broken before it will even do > anything. Proposal: "linux,badly-designed-flash-reset". > > But, I'd prefer just (partially?) reverting this, and let the authors > submit something that works. We're not obligated to keep bad hacks in > the kernel. > > Brian One possibility that occurred to me when I was exploring this issue is to revert to 3-byte mode whenever 4-byte was not actively in use. So any access beyond 16Meg is: switch-to-4-byte ; perform IO ; switch to 3-byte or similar. On my hardware it would be more efficient to use the 4-byte opcode to perform the IO, then reset the cached 4th address byte that the NOR chip transparently remembered. This adds a little overhead, but should be fairly robust. It doesn't help if something goes terribly wrong while IO is happening, but I don't think any other software solution does either. How would you see that approach? Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting

2018-07-23 Thread NeilBrown
On Tue, Jul 24 2018, Boris Brezillon wrote: > On Tue, 24 Jul 2018 08:46:33 +1000 > NeilBrown wrote: > >> On Mon, Jul 23 2018, Brian Norris wrote: >> >> > Hi Boris, >> > >> > On Mon, Jul 23, 2018 at 1:10 PM, Boris Brezillon >> > wrot

Re: [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting

2018-07-24 Thread NeilBrown
On Tue, Jul 24 2018, Brian Norris wrote: > Hi, > > On Tue, Jul 24, 2018 at 11:51:49AM +1000, NeilBrown wrote: >> On Tue, Jul 24 2018, Boris Brezillon wrote: >> > On Tue, 24 Jul 2018 08:46:33 +1000 >> > NeilBrown wrote: >> >> One possibility that occu

Re: [PATCH 2/5] rhashtable: don't hold lock on first table throughout insertion.

2018-07-24 Thread NeilBrown
On Tue, Jul 24 2018, Paul E. McKenney wrote: > On Tue, Jul 24, 2018 at 07:52:03AM +1000, NeilBrown wrote: >> On Mon, Jul 23 2018, Paul E. McKenney wrote: >> >> > On Mon, Jul 23, 2018 at 09:13:43AM +1000, NeilBrown wrote: >> >> On Sun, Jul 22 2018, Paul E.

Re: [PATCH resend] rhashtable: detect when object movement might have invalidated a lookup

2018-07-15 Thread NeilBrown
On Wed, Jul 11 2018, David Miller wrote: > From: David Miller > Date: Wed, 11 Jul 2018 22:46:58 -0700 (PDT) > >> From: NeilBrown >> Date: Fri, 06 Jul 2018 17:08:35 +1000 >> >>> >>> Some users of rhashtable might need to change the key >>&g

[PATCH - revised] rhashtable: detect when object movement might have invalidated a lookup

2018-07-15 Thread NeilBrown
utual exclusion which anything that might change the key, such as successfully taking a new reference. Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 35 +++ lib/rhashtable.c | 8 +--- 2 files changed, 28 insertions(+), 15 deletions(-) diff --

Re: [PATCH 2/3] rhashtable: add rhashtable_walk_last_seen()

2018-07-15 Thread NeilBrown
On Tue, Jul 10 2018, David Miller wrote: > From: NeilBrown > Date: Fri, 06 Jul 2018 17:11:32 +1000 > >> rhashtable_walk_last_seen() returns the object returned by >> the previous rhashtable_walk_next(), providing it is still in the >> table (or was during this grace

Re: [PATCH - revised] rhashtable: detect when object movement might have invalidated a lookup

2018-07-15 Thread NeilBrown
On Mon, Jul 16 2018, Herbert Xu wrote: > On Mon, Jul 16, 2018 at 09:57:11AM +1000, NeilBrown wrote: >> >> Some users of rhashtable might need to change the key >> of an object and move it to a different location in the table. >> Other users might wan

Re: [RFC PATCH v1 00/30] fs: inode->i_version rework and optimization

2017-05-11 Thread NeilBrown
t inode *inode, > *p++ = cpu_to_be32(convert_to_wallclock(exp->cd->flush_time)); > *p++ = 0; > } else if (IS_I_VERSION(inode)) { > - p = xdr_encode_hyper(p, inode->i_version); > + p = xdr_encode_hyper(p, nfsd4_cha

[PATCH 2/2] staging: lustre: libcfs: remove workitem code.

2018-01-10 Thread NeilBrown
There are now no users. workqueues are doing the job that this used to do. Signed-off-by: NeilBrown --- .../staging/lustre/include/linux/libcfs/libcfs.h |1 .../lustre/include/linux/libcfs/libcfs_workitem.h | 104 drivers/staging/lustre/lnet/libcfs/Makefile|2

[PATCH 0/2] staging: lustre: finish removal of workitem code.

2018-01-10 Thread NeilBrown
This is a resend of the last two patches of my "remove workitem code", which resolve a merge conflict and add and 'Ack-by' from Tejun. The first two patches have already been merged. Thanks, NeilBrown Original intro: Lustre has a "workitem" subsystem with much the s

[PATCH 1/2] staging: lustre: lnet: convert selftest to use workqueues

2018-01-10 Thread NeilBrown
workqueue API, that isn't currently exported. lustre needs it to allow workqueue thread to be limited to a subset of CPUs. Acked-by: Tejun Heo (for export of apply_workqueue_attrs) Signed-off-by: NeilBrown --- drivers/staging/lustre/lnet/selftest/framework.c | 10 +--- drivers/staging/l

[md PATCH 0/4] Minor 'cred' improvements prepare for NFS conversion

2018-01-30 Thread NeilBrown
ough the NFS tree when the rest of the patches are ready. Thanks, NeilBrown --- NeilBrown (4): cred: add cred_fscmp() for comparing creds. cred: add get_cred_rcu() cred: export get_task_cred(). cred: allow get_cred() and put_cred() to be given NULL. include/linux/

[PATCH 1/4] cred: add cred_fscmp() for comparing creds.

2018-01-30 Thread NeilBrown
er to more consistent use of 'struct cred' we need a comparison function. This patch adds that function. Signed-off-by: NeilBrown --- include/linux/cred.h |1 + kernel/cred.c| 55 ++ 2 files changed, 56 insertions(+) diff -

[PATCH 3/4] cred: export get_task_cred().

2018-01-30 Thread NeilBrown
There is no reason that modules should not be able to use this, and NFS will need it when converted to use 'struct cred'. Signed-off-by: NeilBrown --- kernel/cred.c |1 + 1 file changed, 1 insertion(+) diff --git a/kernel/cred.c b/kernel/cred.c index f11aa4e0d2b9..3e43bde1fd3c 10

[PATCH 4/4] cred: allow get_cred() and put_cred() to be given NULL.

2018-01-30 Thread NeilBrown
It is common practice of helps like this so silently, accept a NULL pointer. get_rpccred() and put_rpccred() used by NFS act this way and using the same interface will ease the conversion for NFS, and simplify the resulting code. Signed-off-by: NeilBrown --- include/linux/cred.h | 14

[PATCH 2/4] cred: add get_cred_rcu()

2018-01-30 Thread NeilBrown
use it in get_task_cred(). Signed-off-by: NeilBrown --- include/linux/cred.h | 11 +++ kernel/cred.c|2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/cred.h b/include/linux/cred.h index 6dd51e503f23..69ed76f7d49f 100644 --- a/include/linux/cr

[PATCH] staging: lustre: lnet/selftest: fix compile error on UP build

2018-01-22 Thread NeilBrown
ing a cpumask_var and copying into it, rather than sharing the mask. Reported-by: kbuild test robot Fixes: 6106c0f82481 ("staging: lustre: lnet: convert selftest to use workqueues") Signed-off-by: NeilBrown ctb_parts[i].cpt_cpumask; - #else - cpumask_copy(

Re: [PATCH] Documentation: security/credentials.rst: explain need to sort group_list

2018-01-07 Thread NeilBrown
, in case including the kernel-doc in credentials.rst like this was the wrong direction. Thanks, NeilBrown --8<----- From: NeilBrown Subject: [PATCH] Documentation: include kernel-doc in credentials.rst - kernel-doc from include/linux/cred.h, k

[PATCH 5 v2: 00/19] staging: lustre: use standard wait_event macros

2018-01-07 Thread NeilBrown
e (as I understand it) doesn't seem to agree with comments/debug message, or just generally looks odd. Thanks, NeilBrown --- NeilBrown (19): sched/wait: add wait_event_idle() functions. staging: lustre: discard SVC_SIGNAL and related functions staging: lustre: replace si

[PATCH 02/19] staging: lustre: discard SVC_SIGNAL and related functions

2018-01-07 Thread NeilBrown
This flag is never set, so remove checks and remove the flag. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_net.h |6 -- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c |4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers

[PATCH 03/19] staging: lustre: replace simple cases of l_wait_event() with wait_event().

2018-01-07 Thread NeilBrown
needing to block signals. In one case, wait_event_idle_exclusive() is needed. Also remove all l_wait_condition*() macros which were short-cuts for setting lwi to {0}. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_lib.h | 19 drivers/staging/lustre/lustre

[PATCH 06/19] staging: lustre: introduce and use l_wait_event_abortable()

2018-01-07 Thread NeilBrown
return -ERESTARTSYS. l_wait_event_{abortable_,}exclusive follow the Linux pattern. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_lib.h | 24 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 12 +- drivers/staging/lustre/lustre

[PATCH 01/19] sched/wait: add wait_event_idle() functions.

2018-01-07 Thread NeilBrown
() wait_event_idle_exclusive_timeout() This set was chosen because lustre needs them before it can discard its own l_wait_event() macro. Acked-by: Peter Zijlstra (Intel) Signed-off-by: NeilBrown --- include/linux/wait.h | 114 ++ 1 file changed, 114 insertions(+) diff

[PATCH 05/19] staging: lustre: use wait_event_idle_timeout() where appropriate.

2018-01-07 Thread NeilBrown
used. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 10 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 12 +++--- drivers/staging/lustre/lustre/llite/statahead.c| 14 --- drivers/staging/lustre/lustre/mdc/mdc_request.c

[PATCH 04/19] staging: lustre: discard cfs_time_seconds()

2018-01-07 Thread NeilBrown
cfs_time_seconds() converts a number of seconds to the matching number of jiffies. The standard way to do this in Linux is "* HZ". So discard cfs_time_seconds() and use "* HZ" instead. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/libcfs_debug.h |

[PATCH 08/19] staging: lustre: simplify waiting in ldlm_completion_ast()

2018-01-07 Thread NeilBrown
he condition is true if it is signaled. This doesn't quite agree with the comments and debug messages. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 55 +++-- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/drivers/stagin

[PATCH 09/19] staging: lustre: open code polling loop instead of using l_wait_event()

2018-01-07 Thread NeilBrown
Two places that LWI_TIMEOUT_INTERVAL() is used, the outcome is a simple polling loop that polls every second for some event (with a limit). So write a simple loop to make this more apparent. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/llite_lib.c | 11

[PATCH 07/19] staging: lustre: simplify l_wait_event when intr handler but no timeout.

2018-01-07 Thread NeilBrown
function after the wait_event, if -ERESTARTSYS was returned. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 30 +-- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging

[PATCH 15/19] staging: lustre: use explicit poll loop in ptlrpc_service_unlink_rqbd

2018-01-07 Thread NeilBrown
Rather an using l_wait_event(), use wait_event_idle_timeout() with an explicit loop so it is easier to see what is happening. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ptlrpc/service.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers

[PATCH 13/19] staging: lustre: use wait_event_idle_timeout in ptlrpcd()

2018-01-07 Thread NeilBrown
We can replace l_wait_event() with wait_event_idle_timeout() here providing we call the timeout function when wait_event_idle_timeout() returns zero. As ptlrpc_expired_set() returns 1, the l_wait_event() aborts of the first timeout. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre

[PATCH 14/19] staging: lustre: improve waiting in sptlrpc_req_refresh_ctx

2018-01-07 Thread NeilBrown
Replace l_wait_event with wait_event_idle_timeout() and call the handler function explicitly. This makes it more clear what is happening. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ptlrpc/sec.c | 34 1 file changed, 24 insertions(+), 10 deletions

[PATCH 17/19] staging: lustre: remove l_wait_event from ptlrpc_set_wait

2018-01-07 Thread NeilBrown
This is the last remaining use of l_wait_event(). It is the only use of LWI_TIMEOUT_INTR_ALL() which has a meaning that timeouts can be interrupted. Only interrupts by "fatal" signals are allowed, so introduce l_wait_event_abortable_timeout() to support this. Signed-off-by:

[PATCH 16/19] staging: lustre: use explicit poll loop in ptlrpc_unregister_reply

2018-01-07 Thread NeilBrown
replace l_wait_event() with wait_event_idle_timeout() and explicit loop. This approach is easier to understand. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ptlrpc/client.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre

[PATCH 12/19] staging: lustre: make polling loop in ptlrpc_unregister_bulk more obvious

2018-01-07 Thread NeilBrown
This use of l_wait_event() is a polling loop that re-checks every second. Make this more obvious with a while loop and wait_event_idle_timeout(). Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions

[PATCH 11/19] staging: lustre: remove back_to_sleep()

2018-01-07 Thread NeilBrown
laces "back_to_sleep()" is used but using two explicit sleeps. The code in ptlrpcd_add_req() looks odd - why not just have one wait_event_idle()? However I believe this is a faithful transformation of the existing code. Signed-off-by: NeilBrown --- drivers/staging/lustre/lust

[PATCH 10/19] staging: lustre: simplify waiting in ptlrpc_invalidate_import()

2018-01-07 Thread NeilBrown
-off-by: NeilBrown --- drivers/staging/lustre/lustre/ptlrpc/client.c |3 ++- drivers/staging/lustre/lustre/ptlrpc/import.c | 21 - 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre

[PATCH 18/19] staging: lustre: replace l_wait_event_exclusive_head() with wait_event_idle_exclusive

2018-01-07 Thread NeilBrown
timeout setting. The current code arrange for LIFO queuing of waiters, but include/event.h doesn't support that yet. Until it does, fall back on FIFO with wait_event_idle_exclusive{,_timeout}(). Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ptlrpc/service.c |

[PATCH 19/19] staging: lustre: remove l_wait_event() and related code

2018-01-07 Thread NeilBrown
These macros are no longer used, so they can be removed. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_lib.h | 249 1 file changed, 249 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre

Re: [PATCH 03/15] staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.

2018-01-08 Thread NeilBrown
On Mon, Jan 08 2018, Greg Kroah-Hartman wrote: > On Mon, Dec 18, 2017 at 11:46:30AM +1100, NeilBrown wrote: >> All usages of the form >> LIBCFS_ALLOC(variable, sizeof(variable)) >> or >> LIBCFS_ALLOC(variable, sizeof(variable's-type)) >> >> a

[PATCH 00/14] staging:lustre: convert most LIBCFS*ALLOC to k*malloc - V2

2018-01-08 Thread NeilBrown
w. Thanks, NeilBrown == Lustre has some "convenience" macros for allocating and freeing memory. They: - warn if called from interrupt context - use kvmalloc - assume GFP_NOFS (which kvmalloc doesn't support) - print an error if the allocation fails - initialize the memo

[PATCH 04/14] staging: lustre: lnet: use kmalloc/kvmalloc in router_proc

2018-01-08 Thread NeilBrown
, use kvmalloc(). Signed-off-by: NeilBrown --- drivers/staging/lustre/lnet/lnet/router_proc.c | 34 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index 43038f9

[PATCH 05/14] staging: lustre: change some LIBCFS_ALLOC calls to k?alloc(GFP_KERNEL)

2018-01-08 Thread NeilBrown
locations that need changing. As there are quite a lot, I've broken them up into several ad-hoc sets to avoid review-fatigue. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/libcfs_string.h|4 ++-- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|

[PATCH 03/14] staging: lustre: lnet: selftest: don't allocate small strings.

2018-01-08 Thread NeilBrown
e which 99 bytes on the stack, instead of the 24 that would have been allocated for 64-bit pointers. Signed-off-by: NeilBrown --- drivers/staging/lustre/lnet/selftest/conctl.c | 180 - 1 file changed, 29 insertions(+), 151 deletions(-) diff --git a/drivers/staging/lustre/lne

[PATCH 02/14] staging: lustre: lnet: switch to cpumask_var_t

2018-01-08 Thread NeilBrown
() has been called on it. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/libcfs_cpu.h |4 - .../lustre/include/linux/libcfs/linux/linux-cpu.h |4 - .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|6 + drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c|2

[PATCH 06/14] staging: lustre: Convert more LIBCFS_ALLOC allocation to direct GFP_KERNEL

2018-01-08 Thread NeilBrown
None of these need to be GFP_NOFS, so use GFP_KERNEL explicitly with kmalloc(), kvmalloc(), or kvmalloc_array(). Change matching LIBCFS_FREE() to kfree() or kvfree() Signed-off-by: NeilBrown --- .../lustre/lnet/libcfs/linux/linux-module.c|4 +- drivers/staging/lustre/lnet/libcfs

[PATCH 07/14] staging: lustre: more LIBCFS_ALLOC conversions to GFP_KERNEL allocations.

2018-01-08 Thread NeilBrown
None of these need GFP_NOFS so allocate directly. Change matching LIBCFS_FREE() to kfree() or kvfree(). Signed-off-by: NeilBrown --- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 19 +++ drivers/staging/lustre/lnet/lnet/lib-eq.c |9 - drivers

[PATCH 01/14] staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.

2018-01-08 Thread NeilBrown
alloc option, or any of the other minor benefits of LIBCFS_ALLOC(). Signed-off-by: NeilBrown --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 39 ++-- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |4 +- .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c |

[PATCH 10/14] staging: lustre: use kmalloc for allocating ksock_tx

2018-01-08 Thread NeilBrown
The size of the data structure is primarily controlled by the iovec size, which is limited to 256. Entries in this vector are 12 bytes, so the whole will always fit in a page. So it is safe to use kmalloc (kvmalloc not needed). So replace LIBCFS_ALLOC with kmalloc. Signed-off-by: NeilBrown

[PATCH 09/14] staging: lustre: lnet-route: use kmalloc for small allocation

2018-01-08 Thread NeilBrown
This allocation is reasonably small. As the function is called "*_locked", it might not be safe to perform a GFP_KERNEL allocation, so be safe and use GFP_NOFS. Signed-off-by: NeilBrown --- drivers/staging/lustre/lnet/lnet/router.c |5 ++--- 1 file changed, 2 insertions(+), 3

[PATCH 12/14] staging: lustre: opencode LIBCFS_ALLOC_ATOMIC calls.

2018-01-08 Thread NeilBrown
Just call kzalloc(GFP_ATOMIC) directly. We don't need the warning on failure. Signed-off-by: NeilBrown --- .../lustre/lustre/obdclass/lprocfs_status.c|7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status

[PATCH 13/14] staging: lustre: replace LIBCFS_CPT_ALLOC()

2018-01-08 Thread NeilBrown
(..)) in the one case that lnet_cpt_table() isn't used. When LIBCFS_CPT_ALLOC() is replaced, the matching LIBCFS_FREE() is also replaced, with with kfree() or kvfree() as appropriate. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/libcfs_private.h | 19 .../staging/lustre

[PATCH 08/14] staging: lustre: more conversions to GFP_KERNEL allocations.

2018-01-08 Thread NeilBrown
These are not called from filesystem context, so use GFP_KERNEL, not LIBCFS_ALLOC(). Signed-off-by: NeilBrown --- drivers/staging/lustre/lnet/selftest/console.c | 57 +--- drivers/staging/lustre/lnet/selftest/framework.c |4 + drivers/staging/lustre/lnet/selftest

[PATCH 11/14] staging: lustre: cfs_percpt_alloc: use kvmalloc(GFP_KERNEL)

2018-01-08 Thread NeilBrown
this allocation is called from several places, but all are during initialization, so GFP_NOFS is not needed. So use kvmalloc and GFP_KERNEL. Signed-off-by: NeilBrown --- drivers/staging/lustre/lnet/libcfs/libcfs_mem.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH 14/14] staging: lustre: remove LIBCFS_ALLOC, LIBCFS_FREE and related macros.

2018-01-08 Thread NeilBrown
LIBCFS_ALLOC LIBCFS_ALLOC_ATOMIC LIBCFS_ALLOC_POST LIBCFS_CPT_ALLOC LIBCFS_FREE are no longer used, and so are removed. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/libcfs_private.h | 51 1 file changed, 51 deletions(-) diff --git a/drivers/staging

Re: [PATCH 3/4] staging: lustre: lnet: convert selftest to use workqueues

2018-01-08 Thread NeilBrown
On Mon, Jan 08 2018, Greg Kroah-Hartman wrote: > On Mon, Dec 18, 2017 at 12:25:19PM +1100, NeilBrown wrote: >> Instead of the cfs workitem library, use workqueues. >> >> As lnet wants to provide a cpu mask of allowed cpus, it >> needs to be a WQ_UNBOUND work queue

Re: [PATCH 5 v2: 00/19] staging: lustre: use standard wait_event macros

2018-01-08 Thread NeilBrown
On Mon, Jan 08 2018, James Simmons wrote: >> On Mon, Jan 08, 2018 at 02:28:13PM +1100, NeilBrown wrote: >> > Hi, >> > this is a revised version of the patch series I sent under a similar >> > subject in mid December. >> > Improvements are: >&g

Re: [PATCH 11/17] staging: lustre: ptlrpc: use workqueue for pinger

2018-03-11 Thread NeilBrown
On Thu, Mar 08 2018, Dilger, Andreas wrote: > On Mar 1, 2018, at 16:31, NeilBrown wrote: >> >> lustre has a "Pinger" kthread which periodically pings peers >> to ensure all hosts are functioning. >> >> This can more easily be done using a work queu

Re: dcache: remove trylock loops (was Re: [BUG] lock_parent() breakage when used from shrink_dentry_list())

2018-03-12 Thread NeilBrown
de_getsecurity() it only wants a dentry so that it can pass something to __vfs_getxattr(), and that only wants a dentry so it can pass something to ->get. Possibly we should rename d_find_alias() to d_find_hashed_alias() so that people need to make a conscious choice between d_find_hashed_alias() and d_find_any_alias() ?? Thanks, NeilBrown signature.asc Description: PGP signature

[PATCH 0/6] rhashtable: assorted fixes and enhancements

2018-03-26 Thread NeilBrown
go in through the netdev tree if you prefer - the last 4 are needed for lustre to work correctly/optimally. Thanks, NeilBrown --- NeilBrown (6): rhashtable: improve documentation for rhashtable_walk_peek() rhashtable: remove outdated comments about grow_decision etc rhashtable:

[PATCH 1/6] rhashtable: improve documentation for rhashtable_walk_peek()

2018-03-26 Thread NeilBrown
the documentation can be correct without listing too many special cases. I don't think the one user will be affected by the code change. Signed-off-by: NeilBrown --- lib/rhashtable.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/rhashtable.c

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

2018-03-26 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 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-26 Thread NeilBrown
able will return every object that was in the hastable for the duration of the walk, at least once. This can be used, for example, to selectively delete objects from the table. Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 28 ++-- lib/rhashtable.c

[PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-26 Thread NeilBrown
ing the new ->long_chain without locking cannot cause any corruption. Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 18 +++--- lib/rhashtable.c | 27 +++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/include/lin

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

2018-03-26 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. Signed-off-by: NeilBrown --- lib/rhashtable.c |2 ++ 1 file c

<    1   2   3   4   5   6   7   8   9   10   >