mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* ancient block_dev patch
@ 2003-03-24 16:41 davej
  2003-03-24 18:16 ` Andrew Morton
  2003-03-24 18:16 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: davej @ 2003-03-24 16:41 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

Andrew,
 What became of this patch ? Is it needed ?


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/block_dev.c linux-2.5/fs/block_dev.c
--- bk-linus/fs/block_dev.c	2003-03-17 12:40:51.000000000 +0000
+++ linux-2.5/fs/block_dev.c	2003-03-17 13:09:03.000000000 +0000
@@ -653,15 +653,16 @@ int blkdev_put(struct block_device *bdev
 	struct gendisk *disk = bdev->bd_disk;
 
 	down(&bdev->bd_sem);
-	switch (kind) {
-	case BDEV_FILE:
-	case BDEV_FS:
-		sync_blockdev(bd_inode->i_bdev);
-		break;
-	}
 	lock_kernel();
-	if (!--bdev->bd_openers)
+	if (!--bdev->bd_openers) {
+		switch (kind) {
+		case BDEV_FILE:
+		case BDEV_FS:
+			sync_blockdev(bd_inode->i_bdev);
+			break;
+		}
 		kill_bdev(bdev);
+	}
 	if (bdev->bd_contains == bdev) {
 		if (disk->fops->release)
 			ret = disk->fops->release(bd_inode, NULL);

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

* Re: ancient block_dev patch
  2003-03-24 16:41 ancient block_dev patch davej
@ 2003-03-24 18:16 ` Andrew Morton
  2003-03-24 18:16 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2003-03-24 18:16 UTC (permalink / raw)
  To: davej; +Cc: linux-kernel

davej@codemonkey.org.uk wrote:
>
> Andrew,
>  What became of this patch ? Is it needed ?
> 
> 
> ...
>  	down(&bdev->bd_sem);
> -	switch (kind) {
> -	case BDEV_FILE:
> -	case BDEV_FS:
> -		sync_blockdev(bd_inode->i_bdev);
> -		break;
> -	}
>  	lock_kernel();
> -	if (!--bdev->bd_openers)
> +	if (!--bdev->bd_openers) {
> +		switch (kind) {
> +		case BDEV_FILE:
> +		case BDEV_FS:
> +			sync_blockdev(bd_inode->i_bdev);
> +			break;
> +		}
>  		kill_bdev(bdev);
> +	}

Seems so, yes.  Without it we sync the blockdev on every close rather
than on the final one.

It has scary potential to expose existing bugs.  I shall play with it,
thanks.

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

* Re: ancient block_dev patch
  2003-03-24 16:41 ancient block_dev patch davej
  2003-03-24 18:16 ` Andrew Morton
@ 2003-03-24 18:16 ` Christoph Hellwig
  2003-03-24 18:29   ` Arjan van de Ven
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2003-03-24 18:16 UTC (permalink / raw)
  To: davej; +Cc: akpm, linux-kernel

On Mon, Mar 24, 2003 at 04:41:54PM +0000, davej@codemonkey.org.uk wrote:
> Andrew,
>  What became of this patch ? Is it needed ?

It's not needed but a nice speedup for certain loads.  IIRC one of them
was INN directly using blockdevices.


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

* Re: ancient block_dev patch
  2003-03-24 18:16 ` Christoph Hellwig
@ 2003-03-24 18:29   ` Arjan van de Ven
  0 siblings, 0 replies; 4+ messages in thread
From: Arjan van de Ven @ 2003-03-24 18:29 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: davej, akpm, linux-kernel

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

On Mon, 2003-03-24 at 19:16, Christoph Hellwig wrote:
> On Mon, Mar 24, 2003 at 04:41:54PM +0000, davej@codemonkey.org.uk wrote:
> > Andrew,
> >  What became of this patch ? Is it needed ?
> 
> It's not needed but a nice speedup for certain loads.  IIRC one of them
> was INN directly using blockdevices

and certain dvd players

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2003-03-24 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-24 16:41 ancient block_dev patch davej
2003-03-24 18:16 ` Andrew Morton
2003-03-24 18:16 ` Christoph Hellwig
2003-03-24 18:29   ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®