public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@didntduck.org>
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: Wed, 06 Apr 2005 13:09:41 -0400	[thread overview]
Message-ID: <425417D5.20503@didntduck.org> (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?
> 
> If not, I'll work up a set of patches to change ptep_get_and_clear and 
> its callers for post 2.6.12 release.
> 
> - kumar

Because it is an atomic operation.  If you dereference it before 
ptep_get_and_clear() it could change in between.

--
				Brian Gerst

      parent reply	other threads:[~2005-04-06 17:08 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
2005-04-06 17:09   ` Christoph Lameter
2005-04-06 17:55     ` Kumar Gala
2005-04-06 17:09 ` Brian Gerst [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=425417D5.20503@didntduck.org \
    --to=bgerst@didntduck.org \
    --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