public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Kumar Gala <kumar.gala@freescale.com>
Cc: LKML list <linux-kernel@vger.kernel.org>
Subject: Re: return value of ptep_get_and_clear
Date: Thu, 07 Apr 2005 02:48:59 +1000	[thread overview]
Message-ID: <425412FB.7030209@yahoo.com.au> (raw)
In-Reply-To: <a0b2cb42ff815dcf964b7a728f638b87@freescale.com>

Kumar Gala wrote:
> ptep_get_and_clear has a signature that looks something like:
> 
> static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned 
> long addr,
>                                        pte_t *ptep)
> 
> It appears that its suppose to return the pte_t pointed to by ptep 
> before its modified.  Why do we bother doing this?  The caller seems 
> perfectly able to dereference ptep and hold on to it.  Am I missing 
> something here?
> 

You need to be able to *atomically* clear the pte and retrieve the
old value.

Nick

-- 
SUSE Labs, Novell Inc.


  reply	other threads:[~2005-04-06 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-06 16:38 return value of ptep_get_and_clear Kumar Gala
2005-04-06 16:48 ` Nick Piggin [this message]
2005-04-06 17:09   ` Christoph Lameter
2005-04-06 17:55     ` Kumar Gala
2005-04-06 17:09 ` Brian Gerst

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=425412FB.7030209@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=kumar.gala@freescale.com \
    --cc=linux-kernel@vger.kernel.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