linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: patch-2.4.10-pre1
  2001-08-27 20:25 patch-2.4.10-pre1 Linus Torvalds
@ 2001-08-27 19:36 ` Marcelo Tosatti
  2001-08-27 21:31   ` patch-2.4.10-pre1 Linus Torvalds
  2001-08-27 20:40 ` [PATCH] removal of bogus fsync_dev() calls Alexander Viro
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Marcelo Tosatti @ 2001-08-27 19:36 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List



On Mon, 27 Aug 2001, Linus Torvalds wrote:

> 
> Ok, I'm back from Finland, and there's a 2.4.10-pre1 update on kernel.org.
> Changelog appended..

There have been some reports of x-order allocation failures when you where
in Finland. They can be triggered by high IO stress on highmem machines.

The following patch avoids that by allowing tasks allocating bounce memory
(lowmem) to block on low mem IO, thus applying more "IO pressure" to the
lowmem zone. (the lowmem zone is our "IOable memory" anyway, so...)

This sounded the theorically correct approach to me, and it fixed the
problems in practice.

Here goes the patch against 2.4.10pre1.

diff -Nur linux.orig/fs/buffer.c linux/fs/buffer.c
--- linux.orig/fs/buffer.c	Mon Aug 27 17:52:25 2001
+++ linux/fs/buffer.c	Mon Aug 27 17:52:47 2001
@@ -2447,7 +2447,8 @@
 	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 || (gfp_mask & __GFP_NOBOUNCE) &&
+			page->zone != &pgdat_list->node_zones[ZONE_HIGHMEM]) {
 		sync_page_buffers(bh, gfp_mask);
 		/* We waited synchronously, so we can free the buffers. */
 		if (gfp_mask & __GFP_WAIT) {
diff -Nur linux.orig/include/linux/mm.h linux/include/linux/mm.h
--- linux.orig/include/linux/mm.h	Mon Aug 27 17:51:52 2001
+++ linux/include/linux/mm.h	Mon Aug 27 17:52:47 2001
@@ -538,6 +538,8 @@
 #define __GFP_HIGH	0x20	/* Should access emergency pools? */
 #define __GFP_IO	0x40	/* Can start physical IO? */
 #define __GFP_FS	0x80	/* Can call down to low-level FS? */
+#define __GFP_NOBOUNCE	0x100	/* Do not try IO operations which may
+				   result in bounce buffering */
 
 #define GFP_NOIO	(__GFP_HIGH | __GFP_WAIT)
 #define GFP_NOFS	(__GFP_HIGH | __GFP_WAIT | __GFP_IO)
diff -Nur linux.orig/include/linux/slab.h linux/include/linux/slab.h
--- linux.orig/include/linux/slab.h	Mon Aug 27 17:51:50 2001
+++ linux/include/linux/slab.h	Mon Aug 27 17:52:47 2001
@@ -23,7 +23,7 @@
 #define	SLAB_NFS		GFP_NFS
 #define	SLAB_DMA		GFP_DMA
 
-#define SLAB_LEVEL_MASK		(__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS)
+#define SLAB_LEVEL_MASK		(__GFP_NOBOUNCE|__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS)
 #define	SLAB_NO_GROW		0x00001000UL	/* don't grow a cache */
 
 /* flags to pass to kmem_cache_create().
diff -Nur linux.orig/mm/highmem.c linux/mm/highmem.c
--- linux.orig/mm/highmem.c	Mon Aug 27 17:51:57 2001
+++ linux/mm/highmem.c	Mon Aug 27 17:53:48 2001
@@ -321,7 +321,7 @@
 	struct page *page;
 
 repeat_alloc:
-	page = alloc_page(GFP_NOIO);
+	page = alloc_page(GFP_NOIO|__GFP_NOBOUNCE);
 	if (page)
 		return page;
 	/*
@@ -359,7 +359,7 @@
 	struct buffer_head *bh;
 
 repeat_alloc:
-	bh = kmem_cache_alloc(bh_cachep, SLAB_NOIO);
+	bh = kmem_cache_alloc(bh_cachep, SLAB_NOIO|__GFP_NOBOUNCE);
 	if (bh)
 		return bh;
 	/*


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: patch-2.4.10-pre1
  2001-08-27 21:31   ` patch-2.4.10-pre1 Linus Torvalds
@ 2001-08-27 20:17     ` Marcelo Tosatti
  2001-08-28  1:59       ` patch-2.4.10-pre1 Marcelo Tosatti
  0 siblings, 1 reply; 9+ messages in thread
From: Marcelo Tosatti @ 2001-08-27 20:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List



On Mon, 27 Aug 2001, Linus Torvalds wrote:

> 
> On Mon, 27 Aug 2001, Marcelo Tosatti wrote:
> >
> > There have been some reports of x-order allocation failures when you where
> > in Finland. They can be triggered by high IO stress on highmem machines.
> >
> > The following patch avoids that by allowing tasks allocating bounce memory
> > (lowmem) to block on low mem IO, thus applying more "IO pressure" to the
> > lowmem zone. (the lowmem zone is our "IOable memory" anyway, so...)
> 
> I'd much rather set this up by splitting up __GFP_IO into two parts (ie
> __GFP_IO and __GFP_IO_BOUNCE), and avoiding have "negative" bits in the
> gfp_mask. That way the bits in gfp_mask always end up increasing things we
> can do, not ever decreasing them.
> 
> Also, your test is really wrong:
> 
> 	page->zone != &pgdat_list->node_zones[ZONE_HIGHMEM]
> 
> is bogus and assumes MUCH too intimate knowledge of there being only one
> particular zone that is "highmem" (think NUMA machines where each node may
> have its own highmem setup). So it SHOULD be something along the lines of
> 
> 	#ifdef CONFIG_HIGHMEM
> 		if (!(gfp_mask & __GFP_HIGHIO) && PageHighMem(page))
> 			return;
> 	#endif
> 
> inside the write case of sync_page_buffers() (we can, and probably should,
> still _wait_ for highmem buffers - but whether we do it inside
> sync_page_buffers() or inside try_to_free_buffers() is probably mostly a
> matter of taste - I won't argue too much with your choice there).
> 
> Other than that, the basic approach looks sane, I would just prefer for
> the testing and bits to be done more regularly.

Great. I really expected you to be grumpy about the implementation :)

Will implement the idea decently and send you the patch later.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* patch-2.4.10-pre1
@ 2001-08-27 20:25 Linus Torvalds
  2001-08-27 19:36 ` patch-2.4.10-pre1 Marcelo Tosatti
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Linus Torvalds @ 2001-08-27 20:25 UTC (permalink / raw)
  To: Kernel Mailing List


Ok, I'm back from Finland, and there's a 2.4.10-pre1 update on kernel.org.
Changelog appended..

The most noticeable one (under the right loads) is probably the one-liner
by Daniel that avoids some bad behaviour when swapping.

		Linus

-----
pre1:
 - Jeff Hartmann: DRM AGP/alpha cleanups
 - Ben LaHaise: highmem user pagecopy/clear optimization
 - Vojtech Pavlik: VIA IDE driver update
 - Herbert Xu: make cramfs work with HIGHMEM pages
 - David Fennell: awe32 ram size detection improvement
 - Istvan Varadi: umsdos EMD filename bug fix
 - Keith Owens: make min/max work for pointers too
 - Jan Kara: quota initialization fix
 - Brad Hards: Kaweth USB driver update (enable, and fix endianness)
 - Ralf Baechle: MIPS updates
 - David Gibson: airport driver update
 - Rogier Wolff: firestream ATM driver multi-phy support
 - Daniel Phillips: swap read page referenced set - avoid swap thrashing


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] removal of bogus fsync_dev() calls
  2001-08-27 20:25 patch-2.4.10-pre1 Linus Torvalds
  2001-08-27 19:36 ` patch-2.4.10-pre1 Marcelo Tosatti
@ 2001-08-27 20:40 ` Alexander Viro
  2001-08-27 20:42 ` patch-2.4.10-pre1 Alexander Viro
  2001-08-27 23:15 ` patch-2.4.10-pre1 Kurt Garloff
  3 siblings, 0 replies; 9+ messages in thread
From: Alexander Viro @ 2001-08-27 20:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List

	Patch below removes bogus fsync_dev() calls from ->release() instances
and converts dasd.c to use of invalidate_device().  Please, apply.

diff -urN S10-pre1/drivers/i2o/i2o_block.c S10-pre1-sync/drivers/i2o/i2o_block.c
--- S10-pre1/drivers/i2o/i2o_block.c	Thu Aug 16 20:05:47 2001
+++ S10-pre1-sync/drivers/i2o/i2o_block.c	Mon Aug 27 16:36:41 2001
@@ -1195,9 +1195,6 @@
 	if(!dev->i2odev)
 		return 0;
 
-	/* Sync the device so we don't get errors */
-	fsync_dev(inode->i_rdev);
-
 	if (dev->refcnt <= 0)
 		printk(KERN_ALERT "i2ob_release: refcount(%d) <= 0\n", dev->refcnt);
 	dev->refcnt--;
diff -urN S10-pre1/drivers/md/lvm.c S10-pre1-sync/drivers/md/lvm.c
--- S10-pre1/drivers/md/lvm.c	Sun Jul 29 01:54:43 2001
+++ S10-pre1-sync/drivers/md/lvm.c	Mon Aug 27 16:36:41 2001
@@ -1059,7 +1059,6 @@
 	       lvm_name, minor, VG_BLK(minor), LV_BLK(minor));
 #endif
 
-	sync_dev(inode->i_rdev);
 	if (lv_ptr->lv_open == 1) vg_ptr->lv_open--;
 	lv_ptr->lv_open--;
 
diff -urN S10-pre1/drivers/s390/block/dasd.c S10-pre1-sync/drivers/s390/block/dasd.c
--- S10-pre1/drivers/s390/block/dasd.c	Sat Aug 11 14:59:23 2001
+++ S10-pre1-sync/drivers/s390/block/dasd.c	Mon Aug 27 16:36:41 2001
@@ -2140,13 +2140,7 @@
 	}
 	for (i = (1 << DASD_PARTN_BITS) - 1; i >= 0; i--) {
                 int major = device->major_info->gendisk.major;
-		int minor = start + i;
-		kdev_t devi = MKDEV (major, minor);
-		struct super_block *sb = get_super (devi);
-		sync_dev (devi);
-		if (sb)
-			invalidate_inodes (sb);
-		invalidate_buffers (devi);
+		invalidate_device(MKDEV (major, start+i), 1);
 	}
         dasd_destroy_partitions(device);
         dasd_setup_partitions(device);
@@ -2517,7 +2511,6 @@
 		rc = -ENODEV;
                 goto out;
 	}
-	fsync_dev (inp->i_rdev);	/* sync the device */
         count = atomic_dec_return (&device->open_count);
         if ( count == 0) {
                 invalidate_buffers (inp->i_rdev);
diff -urN S10-pre1/drivers/s390/block/xpram.c S10-pre1-sync/drivers/s390/block/xpram.c
--- S10-pre1/drivers/s390/block/xpram.c	Sat Aug 11 14:59:23 2001
+++ S10-pre1-sync/drivers/s390/block/xpram.c	Mon Aug 27 16:36:41 2001
@@ -625,8 +625,7 @@
 	 */
 	if (!atomic_dec_return(&(dev->usage))) {
 		/* but flush it right now */
-		fsync_dev(inode->i_rdev);
-		invalidate_buffers(inode->i_rdev);
+		/* Everything is already flushed by caller -- AV */
 	}
 	MOD_DEC_USE_COUNT;
 	return(0);
diff -urN S10-pre1/drivers/scsi/sr.c S10-pre1-sync/drivers/scsi/sr.c
--- S10-pre1/drivers/scsi/sr.c	Sun Jul 29 01:54:47 2001
+++ S10-pre1-sync/drivers/scsi/sr.c	Mon Aug 27 16:36:41 2001
@@ -101,7 +101,6 @@
 {
 	if (scsi_CDs[MINOR(cdi->dev)].device->sector_size > 2048)
 		sr_set_blocklength(MINOR(cdi->dev), 2048);
-	sync_dev(cdi->dev);
 	scsi_CDs[MINOR(cdi->dev)].device->access_count--;
 	if (scsi_CDs[MINOR(cdi->dev)].device->host->hostt->module)
 		__MOD_DEC_USE_COUNT(scsi_CDs[MINOR(cdi->dev)].device->host->hostt->module);



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: patch-2.4.10-pre1
  2001-08-27 20:25 patch-2.4.10-pre1 Linus Torvalds
  2001-08-27 19:36 ` patch-2.4.10-pre1 Marcelo Tosatti
  2001-08-27 20:40 ` [PATCH] removal of bogus fsync_dev() calls Alexander Viro
@ 2001-08-27 20:42 ` Alexander Viro
  2001-08-28  8:05   ` patch-2.4.10-pre1 Martin Dalecki
  2001-08-27 23:15 ` patch-2.4.10-pre1 Kurt Garloff
  3 siblings, 1 reply; 9+ messages in thread
From: Alexander Viro @ 2001-08-27 20:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List

	Patch fixes the use of ioctls in partitions/ibm.c, removing
a lot of junk in process (fake struct file allocation, set_fs(),
yodda, yodda - we use blkdev_get() and ioctl_by_bdev() instead).
Please, apply

diff -urN S10-pre1/fs/partitions/ibm.c S10-pre1-partition/fs/partitions/ibm.c
--- S10-pre1/fs/partitions/ibm.c	Sat Aug 11 14:59:24 2001
+++ S10-pre1-partition/fs/partitions/ibm.c	Mon Aug 27 16:37:37 2001
@@ -45,67 +45,22 @@
 static int
 get_drive_geometry(int kdev,struct hd_geometry *geo) 
 {
-	int rc = 0;
-	mm_segment_t old_fs;
-	struct file *filp;
-	struct inode *inode;
-        /* find out offset of volume label (partn table) */
-        filp = (struct file *)kmalloc (sizeof(struct file),GFP_KERNEL);
-        if ( filp == NULL ) {
-                printk (KERN_WARNING __FILE__ " ibm_partition: kmalloc failed fo
-r filp\n");
-                return -ENOMEM;
-        }
-        memset(filp,0,sizeof(struct file));
-        filp ->f_mode = 1; /* read only */
-        inode = get_empty_inode();
-	if ( inode == NULL )
-		return -ENOMEM;
-        inode -> i_rdev = kdev;
-	inode -> i_bdev = bdget(kdev_t_to_nr(kdev));
-	rc = blkdev_open(inode,filp);
-        if ( rc == 0 ) {
-		old_fs=get_fs();
-		set_fs(KERNEL_DS);
-		rc = inode-> i_bdev -> bd_op->ioctl (inode, filp, HDIO_GETGEO, 
-						     (unsigned long)(geo))
-			;
-		set_fs(old_fs);
-	}
-	blkdev_put(inode->i_bdev,BDEV_FILE);
+	struct block_device *bdev = bdget(kdev_t_to_nr(kdev));
+	int rc = blkdev_get(bdev, 0, 1, BDEV_FILE);
+        if ( rc == 0 )
+		rc = ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo);
+	blkdev_put(bdev,BDEV_FILE);
 	return rc;
 }
 
 static int
 get_drive_info(int kdev,dasd_information_t *info) 
 {
-	int rc = 0;
-	mm_segment_t old_fs;
-	struct file *filp;
-	struct inode *inode;
-        /* find out offset of volume label (partn table) */
-        filp = (struct file *)kmalloc (sizeof(struct file),GFP_KERNEL);
-        if ( filp == NULL ) {
-                printk (KERN_WARNING __FILE__ " ibm_partition: kmalloc failed fo
-r filp\n");
-                return -ENOMEM;
-        }
-        memset(filp,0,sizeof(struct file));
-        filp ->f_mode = 1; /* read only */
-        inode = get_empty_inode();
-	if ( inode == NULL )
-		return -ENOMEM;
-        inode -> i_rdev = kdev;
-	inode -> i_bdev = bdget(kdev_t_to_nr(kdev));
-        rc = blkdev_open(inode,filp);
-        if ( rc == 0 ) {
-		old_fs=get_fs();
-		set_fs(KERNEL_DS);
-		rc = inode-> i_bdev -> bd_op->ioctl (inode, filp, BIODASDINFO, 
-						     (unsigned long)(info));
-		set_fs(old_fs);
-	}
-	blkdev_put(inode->i_bdev,BDEV_FILE);
+	struct block_device *bdev = bdget(kdev_t_to_nr(kdev));
+	int rc = blkdev_get(bdev, 0, 1, BDEV_FILE);
+        if ( rc == 0 )
+		rc = ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)(info));
+	blkdev_put(bdev,BDEV_FILE);
 	return rc;
 }
 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: patch-2.4.10-pre1
  2001-08-27 19:36 ` patch-2.4.10-pre1 Marcelo Tosatti
@ 2001-08-27 21:31   ` Linus Torvalds
  2001-08-27 20:17     ` patch-2.4.10-pre1 Marcelo Tosatti
  0 siblings, 1 reply; 9+ messages in thread
From: Linus Torvalds @ 2001-08-27 21:31 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Kernel Mailing List


On Mon, 27 Aug 2001, Marcelo Tosatti wrote:
>
> There have been some reports of x-order allocation failures when you where
> in Finland. They can be triggered by high IO stress on highmem machines.
>
> The following patch avoids that by allowing tasks allocating bounce memory
> (lowmem) to block on low mem IO, thus applying more "IO pressure" to the
> lowmem zone. (the lowmem zone is our "IOable memory" anyway, so...)

I'd much rather set this up by splitting up __GFP_IO into two parts (ie
__GFP_IO and __GFP_IO_BOUNCE), and avoiding have "negative" bits in the
gfp_mask. That way the bits in gfp_mask always end up increasing things we
can do, not ever decreasing them.

Also, your test is really wrong:

	page->zone != &pgdat_list->node_zones[ZONE_HIGHMEM]

is bogus and assumes MUCH too intimate knowledge of there being only one
particular zone that is "highmem" (think NUMA machines where each node may
have its own highmem setup). So it SHOULD be something along the lines of

	#ifdef CONFIG_HIGHMEM
		if (!(gfp_mask & __GFP_HIGHIO) && PageHighMem(page))
			return;
	#endif

inside the write case of sync_page_buffers() (we can, and probably should,
still _wait_ for highmem buffers - but whether we do it inside
sync_page_buffers() or inside try_to_free_buffers() is probably mostly a
matter of taste - I won't argue too much with your choice there).

Other than that, the basic approach looks sane, I would just prefer for
the testing and bits to be done more regularly.

		Linus


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: patch-2.4.10-pre1
  2001-08-27 20:25 patch-2.4.10-pre1 Linus Torvalds
                   ` (2 preceding siblings ...)
  2001-08-27 20:42 ` patch-2.4.10-pre1 Alexander Viro
@ 2001-08-27 23:15 ` Kurt Garloff
  3 siblings, 0 replies; 9+ messages in thread
From: Kurt Garloff @ 2001-08-27 23:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux kernel list

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

On Mon, Aug 27, 2001 at 01:25:45PM -0700, Linus Torvalds wrote:
> 
> Ok, I'm back from Finland, and there's a 2.4.10-pre1 update on kernel.org.
> Changelog appended..
> 
> The most noticeable one (under the right loads) is probably the one-liner
> by Daniel that avoids some bad behaviour when swapping.

Looks like a good one.
Actually, I got two wishes for 2.4.10:
* It hopefully overcomes all the VM trouble
  (this list is full of reports; some of my observation look like creating
   dirty pages in the page cache at a high rate makes your system crawl.
   An efficient way is use mkfs with Andrea's blkdev-pgcache patch, but
   it's not the only way.)
* It'll hopefully be identical to 2.5.0,
  so people have a kernel to put experimental stuff in instead of 2.4.x
  Good things can always be backported, once proven stable.

Regards,
-- 
Kurt Garloff                   <kurt@garloff.de>         [Eindhoven, NL]
Physics: Plasma simulations  <K.Garloff@Phys.TUE.NL>  [TU Eindhoven, NL]
Linux: SCSI, Security          <garloff@suse.de>    [SuSE Nuernberg, DE]
 (See mail header or public key servers for PGP2 and GPG public keys.)

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: patch-2.4.10-pre1
  2001-08-27 20:17     ` patch-2.4.10-pre1 Marcelo Tosatti
@ 2001-08-28  1:59       ` Marcelo Tosatti
  0 siblings, 0 replies; 9+ messages in thread
From: Marcelo Tosatti @ 2001-08-28  1:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List



On Mon, 27 Aug 2001, Marcelo Tosatti wrote:

> 
> 
> On Mon, 27 Aug 2001, Linus Torvalds wrote:
> 
> > 
> > On Mon, 27 Aug 2001, Marcelo Tosatti wrote:
> > >
> > > There have been some reports of x-order allocation failures when you where
> > > in Finland. They can be triggered by high IO stress on highmem machines.
> > >
> > > The following patch avoids that by allowing tasks allocating bounce memory
> > > (lowmem) to block on low mem IO, thus applying more "IO pressure" to the
> > > lowmem zone. (the lowmem zone is our "IOable memory" anyway, so...)
> > 
> > I'd much rather set this up by splitting up __GFP_IO into two parts (ie
> > __GFP_IO and __GFP_IO_BOUNCE), and avoiding have "negative" bits in the
> > gfp_mask. That way the bits in gfp_mask always end up increasing things we
> > can do, not ever decreasing them.
> > 
> > Also, your test is really wrong:
> > 
> > 	page->zone != &pgdat_list->node_zones[ZONE_HIGHMEM]
> > 
> > is bogus and assumes MUCH too intimate knowledge of there being only one
> > particular zone that is "highmem" (think NUMA machines where each node may
> > have its own highmem setup). So it SHOULD be something along the lines of
> > 
> > 	#ifdef CONFIG_HIGHMEM
> > 		if (!(gfp_mask & __GFP_HIGHIO) && PageHighMem(page))
> > 			return;
> > 	#endif
> > 
> > inside the write case of sync_page_buffers() (we can, and probably should,
> > still _wait_ for highmem buffers - but whether we do it inside
> > sync_page_buffers() or inside try_to_free_buffers() is probably mostly a
> > matter of taste - I won't argue too much with your choice there).
> > 
> > Other than that, the basic approach looks sane, I would just prefer for
> > the testing and bits to be done more regularly.
> 
> Great. I really expected you to be grumpy about the implementation :)
> 
> Will implement the idea decently and send you the patch later.


Here it goes. 

I tested with two dd's writing 16GB of data total on a 4GB box. 

Note that it may be needed to change __alloc_pages() to call
try_to_free_pages() _even_ for PF_MEMALLOC tasks in case they are trying
to allocate bounce memory (think about a real big number of PF_MEMALLOC
tasks trying to allocate bounce memory at the same time).

However, I'm not sure if that is needed in practice.

diff -Nur linux.orig/fs/buffer.c linux/fs/buffer.c
--- linux.orig/fs/buffer.c	Mon Aug 27 20:46:36 2001
+++ linux/fs/buffer.c	Mon Aug 27 21:43:35 2001
@@ -2448,6 +2448,10 @@
 	write_unlock(&hash_table_lock);
 	spin_unlock(&lru_list_lock);
 	if (gfp_mask & __GFP_IO) {
+#ifdef CONFIG_HIGHMEM
+		if (!(gfp_mask & __GFP_HIGHIO) & PageHighMem(page))
+			return;
+#endif
 		sync_page_buffers(bh, gfp_mask);
 		/* We waited synchronously, so we can free the buffers. */
 		if (gfp_mask & __GFP_WAIT) {
diff -Nur linux.orig/include/linux/mm.h linux/include/linux/mm.h
--- linux.orig/include/linux/mm.h	Mon Aug 27 20:46:37 2001
+++ linux/include/linux/mm.h	Mon Aug 27 20:51:04 2001
@@ -536,17 +536,20 @@
 /* Action modifiers - doesn't change the zoning */
 #define __GFP_WAIT	0x10	/* Can wait and reschedule? */
 #define __GFP_HIGH	0x20	/* Should access emergency pools? */
-#define __GFP_IO	0x40	/* Can start physical IO? */
-#define __GFP_FS	0x80	/* Can call down to low-level FS? */
+#define __GFP_IO	0x40	/* Can start low memory physical IO? */
+#define __GFP_HIGHIO	0x80	/* Can start high mem physical IO? */
+#define __GFP_FS	0x100	/* Can call down to low-level FS? */
 
+#define GFP_NOHIGHIO	(__GFP_HIGH | __GFP_WAIT | __GFP_IO)
 #define GFP_NOIO	(__GFP_HIGH | __GFP_WAIT)
-#define GFP_NOFS	(__GFP_HIGH | __GFP_WAIT | __GFP_IO)
+#define GFP_NOFS	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO)
 #define GFP_ATOMIC	(__GFP_HIGH)
-#define GFP_USER	(             __GFP_WAIT | __GFP_IO | __GFP_FS)
-#define GFP_HIGHUSER	(             __GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM)
-#define GFP_KERNEL	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_FS)
-#define GFP_NFS		(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_FS)
-#define GFP_KSWAPD	(                          __GFP_IO | __GFP_FS)
+#define GFP_USER	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
+#define GFP_HIGHUSER	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO \
+	       	| __GFP_FS | __GFP_HIGHMEM)
+#define GFP_KERNEL	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
+#define GFP_NFS	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
+#define GFP_KSWAPD	(                          __GFP_IO | __GFP_HIGHIO | __GFP_FS)
 
 /* Flag - indicates that the buffer will be suitable for DMA.  Ignored on some
    platforms, used as appropriate on others */
diff -Nur linux.orig/include/linux/slab.h linux/include/linux/slab.h
--- linux.orig/include/linux/slab.h	Mon Aug 27 20:46:37 2001
+++ linux/include/linux/slab.h	Mon Aug 27 21:33:16 2001
@@ -17,13 +17,14 @@
 /* flags for kmem_cache_alloc() */
 #define	SLAB_NOFS		GFP_NOFS
 #define	SLAB_NOIO		GFP_NOIO
+#define SLAB_NOHIGHIO		GFP_NOHIGHIO
 #define	SLAB_ATOMIC		GFP_ATOMIC
 #define	SLAB_USER		GFP_USER
 #define	SLAB_KERNEL		GFP_KERNEL
 #define	SLAB_NFS		GFP_NFS
 #define	SLAB_DMA		GFP_DMA
 
-#define SLAB_LEVEL_MASK		(__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS)
+#define SLAB_LEVEL_MASK		(__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHIO|__GFP_FS)
 #define	SLAB_NO_GROW		0x00001000UL	/* don't grow a cache */
 
 /* flags to pass to kmem_cache_create().
diff -Nur linux.orig/mm/highmem.c linux/mm/highmem.c
--- linux.orig/mm/highmem.c	Mon Aug 27 20:46:37 2001
+++ linux/mm/highmem.c	Mon Aug 27 21:33:23 2001
@@ -321,7 +321,7 @@
 	struct page *page;
 
 repeat_alloc:
-	page = alloc_page(GFP_NOIO);
+	page = alloc_page(GFP_NOHIGHIO);
 	if (page)
 		return page;
 	/*
@@ -359,7 +359,7 @@
 	struct buffer_head *bh;
 
 repeat_alloc:
-	bh = kmem_cache_alloc(bh_cachep, SLAB_NOIO);
+	bh = kmem_cache_alloc(bh_cachep, SLAB_NOHIGHIO);
 	if (bh)
 		return bh;
 	/*


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: patch-2.4.10-pre1
  2001-08-27 20:42 ` patch-2.4.10-pre1 Alexander Viro
@ 2001-08-28  8:05   ` Martin Dalecki
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Dalecki @ 2001-08-28  8:05 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Kernel Mailing List

Alexander Viro wrote:
> 
>         Patch fixes the use of ioctls in partitions/ibm.c, removing
> a lot of junk in process (fake struct file allocation, set_fs(),
> yodda, yodda - we use blkdev_get() and ioctl_by_bdev() instead).
> Please, apply

Well It is a while ago that I was claiming that the IBM blk-dev handling
code seems to be done by someone who got a bit confused... Thank you
for working on fixing this!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-08-28  8:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-27 20:25 patch-2.4.10-pre1 Linus Torvalds
2001-08-27 19:36 ` patch-2.4.10-pre1 Marcelo Tosatti
2001-08-27 21:31   ` patch-2.4.10-pre1 Linus Torvalds
2001-08-27 20:17     ` patch-2.4.10-pre1 Marcelo Tosatti
2001-08-28  1:59       ` patch-2.4.10-pre1 Marcelo Tosatti
2001-08-27 20:40 ` [PATCH] removal of bogus fsync_dev() calls Alexander Viro
2001-08-27 20:42 ` patch-2.4.10-pre1 Alexander Viro
2001-08-28  8:05   ` patch-2.4.10-pre1 Martin Dalecki
2001-08-27 23:15 ` patch-2.4.10-pre1 Kurt Garloff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).