blob: 9f2aa4a718a802cb36107bdea42a8b3c56e32445 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
diff -urN atomic-alloc-ref/fs/buffer.c atomic-alloc/fs/buffer.c
--- atomic-alloc-ref/fs/buffer.c Thu Sep 20 01:44:06 2001
+++ atomic-alloc/fs/buffer.c Thu Sep 20 20:00:42 2001
@@ -2613,7 +2613,7 @@
spin_unlock(&free_list[index].lock);
write_unlock(&hash_table_lock);
spin_unlock(&lru_list_lock);
- if (gfp_mask & __GFP_IO) {
+ if (gfp_mask & __GFP_IO && !(current->flags & PF_ATOMICALLOC)) {
if ((gfp_mask & __GFP_HIGHIO) || !PageHighMem(page)) {
if (sync_page_buffers(bh, gfp_mask)) {
/* no IO or waiting next time */
diff -urN atomic-alloc-ref/include/linux/sched.h atomic-alloc/include/linux/sched.h
--- atomic-alloc-ref/include/linux/sched.h Thu Sep 20 20:00:21 2001
+++ atomic-alloc/include/linux/sched.h Thu Sep 20 20:01:06 2001
@@ -408,18 +408,16 @@
/*
* Per process flags
*/
-#define PF_ALIGNWARN 0x00000001 /* Print alignment warning msgs */
- /* Not implemented yet, only for 486*/
-#define PF_STARTING 0x00000002 /* being created */
-#define PF_EXITING 0x00000004 /* getting shut down */
-#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
-#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
-#define PF_DUMPCORE 0x00000200 /* dumped core */
-#define PF_SIGNALED 0x00000400 /* killed by a signal */
-#define PF_MEMALLOC 0x00000800 /* Allocating memory */
-#define PF_FREE_PAGES 0x00002000 /* per process page freeing */
+#define PF_EXITING (1UL<<0) /* getting shut down */
+#define PF_FORKNOEXEC (1UL<<1) /* forked but didn't exec */
+#define PF_SUPERPRIV (1UL<<2) /* used super-user privileges */
+#define PF_DUMPCORE (1UL<<3) /* dumped core */
+#define PF_SIGNALED (1UL<<4) /* killed by a signal */
+#define PF_MEMALLOC (1UL<<5) /* Allocating memory */
+#define PF_USEDFPU (1UL<<6) /* task used FPU this quantum (SMP) */
+#define PF_ATOMICALLOC (1UL<<7) /* do not block during memalloc */
+#define PF_FREE_PAGES (1UL<<8) /* per process page freeing */
-#define PF_USEDFPU 0x00100000 /* task used FPU this quantum (SMP) */
/*
* Ptrace flags
diff -urN atomic-alloc-ref/mm/slab.c atomic-alloc/mm/slab.c
--- atomic-alloc-ref/mm/slab.c Thu Sep 20 01:44:20 2001
+++ atomic-alloc/mm/slab.c Thu Sep 20 20:00:42 2001
@@ -1715,7 +1715,7 @@
unsigned int scan;
int ret = 0;
- if (gfp_mask & __GFP_WAIT)
+ if (gfp_mask & __GFP_WAIT && !(current->flags & PF_ATOMICALLOC))
down(&cache_chain_sem);
else
if (down_trylock(&cache_chain_sem))
|