Gentoo Archives: gentoo-commits

From: "Richard Yao (ryao)" <ryao@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-kernel/spl/files: spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch
Date: Tue, 10 Jul 2012 00:26:22
Message-Id: 20120710002607.BAE3B20065@flycatcher.gentoo.org
1 ryao 12/07/10 00:26:07
2
3 Added: spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch
4 Log:
5 Make KM_SLEEP an alias of KM_PUSHPAGE like it is in FreeBSD
6
7 (Portage version: 2.1.10.65/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-kernel/spl/files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/spl/files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/spl/files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch?rev=1.1&content-type=text/plain
14
15 Index: spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch
16 ===================================================================
17 From 5c072b45b66e841ebc7952db7860c2ee7b024b08 Mon Sep 17 00:00:00 2001
18 From: Richard Yao <ryao@×××××××××××××.edu>
19 Date: Mon, 25 Jun 2012 20:05:00 -0400
20 Subject: [PATCH] Make KM_SLEEP an alias of KM_PUSHPAGE Use GFP_NOIO in
21 KM_SLEEP
22
23 This should prevent direct reclaim issues without requiring
24 Linux-specific changes to code from Solaris. This is what is done in
25 FreeBSD.
26
27 Note that a change to __taskq_dispatch() module/spl/spl-taskq.c is
28 needed to make this work. Changing KM_PUSHPAGE to use GFP_NOIO is fine,
29 but adding __GFP_HIGH to that triggers a hard-coded panic in
30 __taskq_dispatch() during zvol initialization. Removing the hard coded
31 panic has no ill effects.
32
33 Signed-off-by: Richard Yao <ryao@×××××××××××××.edu>
34 ---
35 include/sys/kmem.h | 2 +-
36 module/spl/spl-taskq.c | 7 ++++---
37 2 files changed, 5 insertions(+), 4 deletions(-)
38
39 diff --git a/include/sys/kmem.h b/include/sys/kmem.h
40 index 796af44..633278b 100644
41 --- a/include/sys/kmem.h
42 +++ b/include/sys/kmem.h
43 @@ -41,7 +41,7 @@
44 /*
45 * Memory allocation interfaces
46 */
47 -#define KM_SLEEP GFP_KERNEL /* Can sleep, never fails */
48 +#define KM_SLEEP (GFP_NOIO | __GFP_HIGH) /* Can sleep, never fails */
49 #define KM_NOSLEEP GFP_ATOMIC /* Can not sleep, may fail */
50 #define KM_PUSHPAGE (GFP_NOIO | __GFP_HIGH) /* Use reserved memory */
51 #define KM_NODEBUG __GFP_NOWARN /* Suppress warnings */
52 diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c
53 index 0c546c7..5ab387e 100644
54 --- a/module/spl/spl-taskq.c
55 +++ b/module/spl/spl-taskq.c
56 @@ -255,9 +255,10 @@
57 if (!(flags & (TQ_SLEEP | TQ_NOSLEEP)))
58 flags |= TQ_SLEEP;
59
60 - if (unlikely(in_atomic() && (flags & TQ_SLEEP)))
61 - PANIC("May schedule while atomic: %s/0x%08x/%d\n",
62 - current->comm, preempt_count(), current->pid);
63 + /* FIXME: Why does this fail when KM_SLEEP contains __GFP_HIGHMEM? */
64 + //if (unlikely(in_atomic() && (flags & TQ_SLEEP)))
65 + // PANIC("May schedule while atomic: %s/0x%08x/%d\n",
66 + // current->comm, preempt_count(), current->pid);
67
68 spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags);
69
70 --
71 1.7.10