mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Paul Jackson <pj@sgi.com>
Cc: torvalds@osdl.org, Simon.Derr@bull.net, pj@sgi.com,
	linux-kernel@vger.kernel.org, nikita@clusterfs.com
Subject: Re: [PATCH] cpuset semaphore depth check optimize
Date: Mon, 12 Sep 2005 04:39:43 -0700	[thread overview]
Message-ID: <20050912043943.5795d8f8.akpm@osdl.org> (raw)
In-Reply-To: <20050912113030.15934.9433.sendpatchset@jackhammer.engr.sgi.com>

Paul Jackson <pj@sgi.com> wrote:
>
>  +static struct task_struct *cpuset_sem_owner;
>  +static int cpuset_sem_depth;
>   
>   /*
>    * The global cpuset semaphore cpuset_sem can be needed by the
>  @@ -200,16 +202,19 @@ static DECLARE_MUTEX(cpuset_sem);
>   
>   static inline void cpuset_down(struct semaphore *psem)
>   {
>  -	if (current->cpuset_sem_nest_depth == 0)
>  +	if (cpuset_sem_owner != current) {
>   		down(psem);
>  -	current->cpuset_sem_nest_depth++;
>  +		cpuset_sem_owner = current;
>  +	}
>  +	cpuset_sem_depth++;
>   }

Better, but still hacky.  The rest of the kernel manages to avoid the need
for nestable semaphores by getting the locking design sorted out.  Can
cpusets do that sometime?


  reply	other threads:[~2005-09-12 11:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-12 11:30 Paul Jackson
2005-09-12 11:39 ` Andrew Morton [this message]
2005-09-12 14:38   ` Linus Torvalds
2005-09-12 15:32     ` Paul Jackson
     [not found]     ` <17189.39100.862561.865802@gargle.gargle.HOWL>
2005-09-12 15:38       ` Paul Jackson
2005-09-13  7:04     ` Ingo Molnar
2005-09-13 22:21       ` Paul Jackson
2005-09-12 14:51   ` Paul Jackson
2005-09-12 17:07     ` Roman Zippel
     [not found]       ` <20050912153135.3812d8e2.pj@sgi.com>
2005-09-13 11:42         ` Roman Zippel
2005-09-13 17:37           ` Paul Jackson
2005-09-14  6:01             ` Paul Jackson
2005-09-14 15:56             ` Roman Zippel
2005-09-14 19:46               ` Paul Jackson
2005-09-15 10:51                 ` Roman Zippel
2005-09-15 17:45                   ` Paul Jackson
2005-09-15 19:18                     ` Paul Jackson
2005-09-17  2:06                     ` Roman Zippel
2005-09-17  2:27                       ` Roman Zippel
2005-09-20  7:57                     ` Paul Jackson
2005-09-20 12:05                       ` Robin Holt
2005-09-20 12:21                         ` Robin Holt
2005-09-20 13:10                         ` Simon Derr
2005-09-20 14:22                         ` Paul Jackson
2005-09-20 14:54                           ` Robin Holt
2005-09-20 15:07                             ` Linus Torvalds
2005-09-20 15:14                             ` Paul Jackson
2005-09-20 15:17                             ` Simon Derr
2005-09-12 11:48 ` Nikita Danilov
2005-09-12 13:25   ` Paul Jackson

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=20050912043943.5795d8f8.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=Simon.Derr@bull.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikita@clusterfs.com \
    --cc=pj@sgi.com \
    --cc=torvalds@osdl.org \
    /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

all inboxes | Powered by JetHome®