[PATCH net-next v2] rhashtable: Allow other tasks to be scheduled in large lookup loops

2015-07-17 Thread Thomas Graf
Depending on system speed, the large lookup/insert/delete loops of the 
testsuite can
take a considerable amount of time to complete causing watchdog warnings to 
appear.
Allow other tasks to be scheduled throughout the loops.

Reported-by: Meelis Roos 
Signed-off-by: Thomas Graf 
---
v2: Use cond_resched() instead schedule()

 lib/test_rhashtable.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c
index c90777e..9af7cef 100644
--- a/lib/test_rhashtable.c
+++ b/lib/test_rhashtable.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define MAX_ENTRIES100
 #define TEST_INSERT_FAIL INT_MAX
@@ -87,6 +88,8 @@ static int __init test_rht_lookup(struct rhashtable *ht)
return -EINVAL;
}
}
+
+   cond_resched_rcu();
}
 
return 0;
@@ -160,6 +163,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
} else if (err) {
return err;
}
+
+   cond_resched();
}
 
if (insert_fails)
@@ -183,6 +188,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
 
rhashtable_remove_fast(ht, &obj->node, test_rht_params);
}
+
+   cond_resched();
}
 
end = ktime_get_ns();
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v2] rhashtable: Allow other tasks to be scheduled in large lookup loops

2015-07-17 Thread Eric Dumazet
On Fri, 2015-07-17 at 10:52 +0200, Thomas Graf wrote:
> Depending on system speed, the large lookup/insert/delete loops of the 
> testsuite can
> take a considerable amount of time to complete causing watchdog warnings to 
> appear.
> Allow other tasks to be scheduled throughout the loops.
> 
> Reported-by: Meelis Roos 
> Signed-off-by: Thomas Graf 
> ---
> v2: Use cond_resched() instead schedule()

Acked-by: Eric Dumazet 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v2] rhashtable: Allow other tasks to be scheduled in large lookup loops

2015-07-17 Thread mroos
> Depending on system speed, the large lookup/insert/delete loops of the 
> testsuite can
> take a considerable amount of time to complete causing watchdog warnings to 
> appear.
> Allow other tasks to be scheduled throughout the loops.
> 
> Reported-by: Meelis Roos 
> Signed-off-by: Thomas Graf 
> ---
> v2: Use cond_resched() instead schedule()

Tested it. The warning is gone from rhashtable test but now it is 
present in rbtree test (it was not there before). Same kernel, just your 
patch applied - but it should not change rbtree test???

[0.00] PROMLIB: Sun IEEE Boot Prom 'OBP 3.31.0 2001/07/25 20:36'
[0.00] PROMLIB: Root node compatible: 
[0.00] Linux version 4.2.0-rc2-00077-gf760b87-dirty (mroos@u5) (gcc 
version 4.9.3 (Debian 4.9.3-1) ) #21 Fri Jul 17 20:15:21 EEST 2015
[0.00] bootconsole [earlyprom0] enabled
[0.00] ARCH: SUN4U
[0.00] Ethernet address: 08:00:20:f8:c7:72
[0.00] MM: PAGE_OFFSET is 0xf800 (max_phys_bits == 40)
[0.00] MM: VMALLOC [0x0001 --> 0x0600]
[0.00] MM: VMEMMAP [0x0600 --> 0x0c00]
[0.00] Kernel: Using 10 locked TLB entries for main kernel image.
[0.00] Remapping the kernel... done.
[0.00] kmemleak: Kernel memory leak detector disabled
[0.00] OF stdout device is: /pci@1f,0/pci@1,1/ebus@1/se@14,40:a
[0.00] PROM: Built device tree with 70266 bytes of memory.
[0.00] Top of RAM: 0x1ff2c000, Total RAM: 0x1ff2a000
[0.00] Memory hole size: 0MB
[0.00] Allocated 16384 bytes for kernel page tables.
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x-0x1ff2bfff]
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x-0x1fefdfff]
[0.00]   node   0: [mem 0x1ff0-0x1ff2bfff]
[0.00] Initmem setup node 0 [mem 0x-0x1ff2bfff]
[0.00] On node 0 totalpages: 65429
[0.00]   Normal zone: 512 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 65429 pages, LIFO batch:15
[0.00] Booting Linux...
[0.00] CPU CAPS: [flush,stbar,swap,muldiv,v9,mul32,div32,v8plus]
[0.00] CPU CAPS: [vis]
[0.00] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[0.00] pcpu-alloc: [0] 0 
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 64917
[0.00] Kernel command line: root=/dev/sda1 ro
[0.00] PID hash table entries: 2048 (order: 1, 16384 bytes)
[0.00] Dentry cache hash table entries: 65536 (order: 6, 524288 bytes)
[0.00] Inode-cache hash table entries: 32768 (order: 5, 262144 bytes)
[0.00] Sorting __ex_table...
[0.00] Memory: 475912K/523432K available (5270K kernel code, 516K 
rwdata, 1672K rodata, 520K init, 30210K bss, 47520K reserved, 0K cma-reserved)
[0.00] Running RCU self tests
[0.00] Testing tracer nop: PASSED
[0.00] NR_IRQS:2048 nr_irqs:2048 1
[   26.882478] clocksource: tick: mask: 0x max_cycles: 
0x5306eb473f, max_idle_ns: 440795213232 ns
[   26.986192] clocksource: mult[2c71c72] shift[24]
[   27.025729] clockevent: mult[5c28f5c3] shift[32]
[   27.067997] Console: colour dummy device 80x25
[   27.104149] console [tty0] enabled
[   27.128868] bootconsole [earlyprom0] disabled
[   27.165340] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., 
Ingo Molnar
[   27.165405] ... MAX_LOCKDEP_SUBCLASSES:  8
[   27.165445] ... MAX_LOCK_DEPTH:  48
[   27.165486] ... MAX_LOCKDEP_KEYS:8191
[   27.165529] ... CLASSHASH_SIZE:  4096
[   27.165574] ... MAX_LOCKDEP_ENTRIES: 32768
[   27.165617] ... MAX_LOCKDEP_CHAINS:  65536
[   27.165662] ... CHAINHASH_SIZE:  32768
[   27.165706]  memory used by lock dependency info: 8159 kB
[   27.165756]  per task-struct memory footprint: 1920 bytes
[   27.165802] 
[   27.165838] | Locking API testsuite:
[   27.165873] 

[   27.165932]  | spin |wlock |rlock |mutex | 
wsem | rsem |
[   27.165993]   
--
[   27.166092]  A-A deadlock:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   27.232682]  A-B-B-A deadlock:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   27.299789]  A-B-B-C-C-A deadlock:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   27.367295]  A-B-C-A-B-C deadlock:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   27.434877]  A-B-B-C-C-D-D-A deadlock:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   27.502857]  A-B-C-D-B-D-D-A deadlock:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   27.5709

Re: [PATCH net-next v2] rhashtable: Allow other tasks to be scheduled in large lookup loops

2015-07-17 Thread Eric Dumazet
On Fri, 2015-07-17 at 22:07 +0300, mr...@linux.ee wrote:
> > Depending on system speed, the large lookup/insert/delete loops of the 
> > testsuite can
> > take a considerable amount of time to complete causing watchdog warnings to 
> > appear.
> > Allow other tasks to be scheduled throughout the loops.
> > 
> > Reported-by: Meelis Roos 
> > Signed-off-by: Thomas Graf 
> > ---
> > v2: Use cond_resched() instead schedule()
> 
> Tested it. The warning is gone from rhashtable test but now it is 
> present in rbtree test (it was not there before). Same kernel, just your 
> patch applied - but it should not change rbtree test???

Why not ?

rbtree tests need same kind of patches.




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v2] rhashtable: Allow other tasks to be scheduled in large lookup loops

2015-07-21 Thread David Miller
From: Thomas Graf 
Date: Fri, 17 Jul 2015 10:52:48 +0200

> Depending on system speed, the large lookup/insert/delete loops of the 
> testsuite can
> take a considerable amount of time to complete causing watchdog warnings to 
> appear.
> Allow other tasks to be scheduled throughout the loops.
> 
> Reported-by: Meelis Roos 
> Signed-off-by: Thomas Graf 
> ---
> v2: Use cond_resched() instead schedule()

Applied, thanks Thomas.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html