linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Prasanna Meda <mlp@google.com>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] alloc uid cleanup
Date: Mon, 17 Apr 2006 21:53:18 -0700	[thread overview]
Message-ID: <20060417215318.29f0f7e0.akpm@osdl.org> (raw)
In-Reply-To: <E1FVZH8-0004f1-8s@blr-eng3.blr.corp.google.com>

Prasanna Meda <mlp@google.com> wrote:
>
> Cleanup: Release the lock before key_put methods. They call 
>  schedule_work etc. They block interrupts now, so it is not bug fix.
> 
>  Signed-off-by: Prasanna Meda
> 
>  --- a/kernel/user.c	2006-04-17 23:02:54.000000000 +0530
>  +++ b/kernel/user.c	2006-04-17 23:06:01.000000000 +0530
>  @@ -160,15 +160,15 @@ struct user_struct * alloc_uid(uid_t uid
>   		spin_lock_irq(&uidhash_lock);
>   		up = uid_hash_find(uid, hashent);
>   		if (up) {
>  +			spin_unlock_irq(&uidhash_lock);
>   			key_put(new->uid_keyring);
>   			key_put(new->session_keyring);
>   			kmem_cache_free(uid_cachep, new);
>   		} else {
>   			uid_hash_insert(new, hashent);
>   			up = new;
>  +			spin_unlock_irq (&uidhash_lock);
>   		}
>  -		spin_unlock_irq(&uidhash_lock);
>  -
>   	}
>   	return up;
>   }

The path you're optimising is the wildly-improbable
we-raced-with-someone-else one.  The benefits from this patch will most
likely be outweighed by the loss of increased text size.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2006-04-18  4:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-17 19:20 Prasanna Meda
2006-04-18  4:53 ` Andrew Morton [this message]

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=20060417215318.29f0f7e0.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    --cc=mlp@google.com \
    /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