Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262249AbVDFQtJ (ORCPT ); Wed, 6 Apr 2005 12:49:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262256AbVDFQtJ (ORCPT ); Wed, 6 Apr 2005 12:49:09 -0400 Received: from smtp203.mail.sc5.yahoo.com ([216.136.129.93]:29536 "HELO smtp203.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S262249AbVDFQtG (ORCPT ); Wed, 6 Apr 2005 12:49:06 -0400 Message-ID: <425412FB.7030209@yahoo.com.au> Date: Thu, 07 Apr 2005 02:48:59 +1000 From: Nick Piggin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Kumar Gala CC: LKML list Subject: Re: return value of ptep_get_and_clear References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 820 Lines: 26 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. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/