Binary files 2.4.7pre2/ID and atomic-alloc/ID differ
diff -urN 2.4.7pre2/fs/buffer.c atomic-alloc/fs/buffer.c
--- 2.4.7pre2/fs/buffer.c	Wed Jul  4 04:03:46 2001
+++ atomic-alloc/fs/buffer.c	Thu Jul  5 17:11:52 2001
@@ -2384,7 +2384,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)) {
 		sync_page_buffers(bh, gfp_mask);
 		/* We waited synchronously, so we can free the buffers. */
 		if ((gfp_mask & __GFP_WAIT) && !loop) {
diff -urN 2.4.7pre2/include/linux/sched.h atomic-alloc/include/linux/sched.h
--- 2.4.7pre2/include/linux/sched.h	Wed Jun 13 17:24:30 2001
+++ atomic-alloc/include/linux/sched.h	Thu Jul  5 17:11:02 2001
@@ -403,18 +403,15 @@
 /*
  * 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_VFORK	0x00001000	/* Wake up parent in mm_release */
-
-#define PF_USEDFPU	0x00100000	/* task used FPU this quantum (SMP) */
+#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_VFORK	(1UL<<6)	/* Wake up parent in mm_release */
+#define PF_USEDFPU	(1UL<<7)	/* task used FPU this quantum (SMP) */
+#define PF_ATOMICALLOC	(1UL<<8)	/* do not block during memalloc */
 
 /*
  * Ptrace flags
diff -urN 2.4.7pre2/mm/page_alloc.c atomic-alloc/mm/page_alloc.c
--- 2.4.7pre2/mm/page_alloc.c	Wed Jul  4 04:03:47 2001
+++ atomic-alloc/mm/page_alloc.c	Thu Jul  5 17:11:02 2001
@@ -372,7 +372,7 @@
 	 *   able to free some memory we can't free ourselves
 	 */
 	wakeup_kswapd();
-	if (gfp_mask & __GFP_WAIT) {
+	if (gfp_mask & __GFP_WAIT && !(current->flags & PF_ATOMICALLOC)) {
 		__set_current_state(TASK_RUNNING);
 		current->policy |= SCHED_YIELD;
 		schedule();
diff -urN 2.4.7pre2/mm/slab.c atomic-alloc/mm/slab.c
--- 2.4.7pre2/mm/slab.c	Sat May 26 04:03:50 2001
+++ atomic-alloc/mm/slab.c	Thu Jul  5 17:11:02 2001
@@ -1690,7 +1690,7 @@
 	unsigned int best_len;
 	unsigned int scan;
 
-	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))