public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <andrewm@uow.edu.au>
To: kumon@flab.fujitsu.co.jp, Andi Kleen <ak@suse.de>,
	Alexander Viro <viro@math.psu.edu>,
	"Jeff V. Merkey" <jmerkey@timpanogas.org>,
	Rik van Riel <riel@conectiva.com.br>,
	linux-kernel@vger.kernel.org, Olaf Kirch <okir@monad.swb.de>
Subject: Re: [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was:  Strange performance behavior of 2.4.0-test9)
Date: Sun, 29 Oct 2000 03:46:13 +1100	[thread overview]
Message-ID: <39FB02D5.9AF89277@uow.edu.au> (raw)
In-Reply-To: <39F957BC.4289FF10@uow.edu.au>, <39F92187.A7621A09@timpanogas.org> <Pine.GSO.4.21.0010270257550.18660-100000@weyl.math.psu.edu> <20001027094613.A18382@gruyere.muc.suse.de> <39F957BC.4289FF10@uow.edu.au> <200010271257.VAA24374@asami.proc.flab.fujitsu.co.jp> <39FAF4C6.3BB04774@uow.edu.au>

Andrew Morton wrote:
> 
> I think it's more expedient at this time to convert
> acquire_fl_sem/release_fl_sem into lock_kernel/unlock_kernel
> (so we _can_ sleep) and to fix the above alleged deadlock
> via the creation of __posix_unblock_lock()

I agree with me.  Could you please test the scalability
of this?



--- linux-2.4.0-test10-pre5/fs/locks.c	Tue Oct 24 21:34:13 2000
+++ linux-akpm/fs/locks.c	Sun Oct 29 03:34:15 2000
@@ -1706,11 +1706,25 @@
 posix_unblock_lock(struct file_lock *waiter)
 {
 	acquire_fl_sem();
+	__posix_unblock_lock(waiter);
+	release_fl_sem();
+}
+
+/**
+ *	__posix_unblock_lock - stop waiting for a file lock
+ *	@waiter: the lock which was waiting
+ *
+ *	lockd needs to block waiting for locks.
+ *	Like posix_unblock_lock(), except it doesn't
+ *	acquire the file lock semaphore.
+ */
+void
+__posix_unblock_lock(struct file_lock *waiter)
+{
 	if (!list_empty(&waiter->fl_block)) {
 		locks_delete_block(waiter);
 		wake_up(&waiter->fl_wait);
 	}
-	release_fl_sem();
 }
 
 static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
--- linux-2.4.0-test10-pre5/include/linux/fs.h	Tue Oct 24 21:34:13 2000
+++ linux-akpm/include/linux/fs.h	Sun Oct 29 03:32:00 2000
@@ -564,6 +564,7 @@
 extern struct file_lock *posix_test_lock(struct file *, struct file_lock *);
 extern int posix_lock_file(struct file *, struct file_lock *, unsigned int);
 extern void posix_block_lock(struct file_lock *, struct file_lock *);
+extern void __posix_unblock_lock(struct file_lock *);
 extern void posix_unblock_lock(struct file_lock *);
 extern int __get_lease(struct inode *inode, unsigned int flags);
 extern time_t lease_get_mtime(struct inode *);
--- linux-2.4.0-test10-pre5/kernel/ksyms.c	Sun Oct 15 01:27:46 2000
+++ linux-akpm/kernel/ksyms.c	Sun Oct 29 03:32:38 2000
@@ -221,6 +221,7 @@
 EXPORT_SYMBOL(posix_lock_file);
 EXPORT_SYMBOL(posix_test_lock);
 EXPORT_SYMBOL(posix_block_lock);
+EXPORT_SYMBOL(__posix_unblock_lock);
 EXPORT_SYMBOL(posix_unblock_lock);
 EXPORT_SYMBOL(locks_mandatory_area);
 EXPORT_SYMBOL(dput);
--- linux-2.4.0-test10-pre5/fs/lockd/svclock.c	Tue Oct 24 21:34:13 2000
+++ linux-akpm/fs/lockd/svclock.c	Sun Oct 29 03:32:22 2000
@@ -456,7 +456,7 @@
 	struct nlm_block	**bp, *block;
 
 	dprintk("lockd: VFS unblock notification for block %p\n", fl);
-	posix_unblock_lock(fl);
+	__posix_unblock_lock(fl);
 	for (bp = &nlm_blocked; (block = *bp); bp = &block->b_next) {
 		if (nlm_compare_locks(&block->b_call.a_args.lock.fl, fl)) {
 			svc_wake_up(block->b_daemon);
--- linux-2.4.0-test10-pre5/fs/fcntl.c	Sun Oct 15 01:27:45 2000
+++ linux-akpm/fs/fcntl.c	Sun Oct 29 03:35:47 2000
@@ -254,11 +254,15 @@
 			unlock_kernel();
 			break;
 		case F_GETLK:
+			lock_kernel();
 			err = fcntl_getlk(fd, (struct flock *) arg);
+			unlock_kernel();
 			break;
 		case F_SETLK:
 		case F_SETLKW:
+			lock_kernel();
 			err = fcntl_setlk(fd, cmd, (struct flock *) arg);
+			unlock_kernel();
 			break;
 		case F_GETOWN:
 			/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2000-10-28 16:47 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200010250736.QAA12373@asami.proc.flab.fujitsu.co.jp>
     [not found] ` <Pine.LNX.4.21.0010251242050.943-100000@duckman.distro.conectiva>
     [not found]   ` <200010260138.KAA17028@asami.proc.flab.fujitsu.co.jp>
     [not found]     ` <200010261405.XAA19135@asami.proc.flab.fujitsu.co.jp>
2000-10-27  6:24       ` Negative scalability by removal of lock_kernel()? (Was: Strange performance behavior of 2.4.0-test9) kumon
2000-10-27  6:32         ` Negative scalability by removal of lock_kernel()?(Was: " Jeff V. Merkey
2000-10-27  7:13           ` Alexander Viro
2000-10-27  7:46             ` Andi Kleen
2000-10-27 10:23               ` Andrew Morton
2000-10-27 10:25                 ` Andi Kleen
2000-10-27 12:57                 ` [PATCH] " kumon
2000-10-28 15:46                   ` Andrew Morton
2000-10-28 15:58                     ` Andi Kleen
2000-10-28 16:05                     ` Jeff Garzik
2000-10-28 16:20                     ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was: Alan Cox
2000-10-29 19:45                       ` dean gaudet
2000-10-30  6:29                         ` Andi Kleen
2000-10-30 15:28                           ` Andrea Arcangeli
2000-10-30 16:36                             ` Rik van Riel
2000-10-30 18:02                               ` Andrea Arcangeli
2000-10-28 16:46                     ` Andrew Morton [this message]
2000-10-30  9:27                       ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was: Strange performance behavior of 2.4.0-test9) kumon
2000-10-30 15:00                         ` Andrew Morton
2000-10-30 23:24                           ` dean gaudet
2000-11-04  5:08                             ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was:Strange " Andrew Morton
2000-11-04  6:23                               ` Linus Torvalds
2000-11-04 10:54                                 ` [PATCH] Re: Negative scalability by removal of Alan Cox
2000-11-04 17:22                                   ` Linus Torvalds
2000-11-05 16:22                                     ` Andrea Arcangeli
2000-11-05 20:21                                   ` dean gaudet
2000-11-05 22:43                                     ` Alan Cox
2000-11-04 20:03                                 ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was:Strange performance behavior of 2.4.0-test9) dean gaudet
2000-11-04 20:42                                   ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was:Strange Alan Cox
2000-11-04 20:11                               ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was:Strange performance behavior of 2.4.0-test9) dean gaudet
2000-11-04 20:43                                 ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was:Strange Alan Cox
2000-11-05  4:52                                   ` dean gaudet
2000-10-31 15:36                   ` [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was: Strange performance behavior of 2.4.0-test9) Andrew Morton
2000-11-01  1:02                     ` kumon
2000-11-02 11:09                     ` kumon
2000-11-02 12:50                       ` kumon
2000-11-04  5:07                       ` Andrew Morton
2000-10-27  8:17             ` Jeff V. Merkey
2000-10-27 10:11             ` kumon
2000-11-04  5:55             ` Preemptive scheduling of woken-up processes kumon
2000-11-05  4:19 [PATCH] Re: Negative scalability by removal of lock_kernel()?(Was:Strange performance behavior of 2.4.0-test9) Dave Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39FB02D5.9AF89277@uow.edu.au \
    --to=andrewm@uow.edu.au \
    --cc=ak@suse.de \
    --cc=jmerkey@timpanogas.org \
    --cc=kumon@flab.fujitsu.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okir@monad.swb.de \
    --cc=riel@conectiva.com.br \
    --cc=viro@math.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox