Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966129Ab2JZTQh (ORCPT ); Fri, 26 Oct 2012 15:16:37 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:47133 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933966Ab2JZTQg (ORCPT ); Fri, 26 Oct 2012 15:16:36 -0400 MIME-Version: 1.0 In-Reply-To: <508ADD2F.6030805@redhat.com> References: <20121025121617.617683848@chello.nl> <20121025124832.840241082@chello.nl> <5089F5B5.1050206@redhat.com> <508A0A0D.4090001@redhat.com> <508A8D31.9000106@redhat.com> <20121026132601.GC9886@gmail.com> <20121026144615.2276cd59@dull> <508ADD2F.6030805@redhat.com> From: Linus Torvalds Date: Fri, 26 Oct 2012 12:16:14 -0700 X-Google-Sender-Auth: t_R8Q-HydGymzJRIBsb2UHJPFAo Message-ID: Subject: Re: [PATCH 3/3] mm,generic: only flush the local TLB in ptep_set_access_flags To: Rik van Riel Cc: Ingo Molnar , Andi Kleen , Michel Lespinasse , Peter Zijlstra , Andrea Arcangeli , Mel Gorman , Johannes Weiner , Thomas Gleixner , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 26 On Fri, Oct 26, 2012 at 11:57 AM, Rik van Riel wrote: > > It looks like do_wp_page also sets the write bit in the pte > "entry" before passing it to ptep_set_access_flags, making > that the place where the write bit is set in the pte. > > Is this a bug in do_wp_page? Hmm. Right you are. That's indeed worth noting that it can indeed change access permissions in that particular way (ie enabling writes). So yeah, good catch. And it's ok to add the writeable bits like this (and it can't race with hardware like the dirty bit can, since hardware never sets writability). In fact, it should probably be documented in the source code somewhere. In particular, there's a very subtle requirement that you can only set the writable bit if the dirty bit is also set at the same time, for example. Linus -- 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/