From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-f52.google.com (mail-qa0-f52.google.com [209.85.216.52]) by kanga.kvack.org (Postfix) with ESMTP id 9A2F96B0070 for ; Tue, 22 Apr 2014 19:35:44 -0400 (EDT) Received: by mail-qa0-f52.google.com with SMTP id ih12so183899qab.11 for ; Tue, 22 Apr 2014 16:35:44 -0700 (PDT) Received: from mail.zytor.com (terminus.zytor.com. [2001:1868:205::10]) by mx.google.com with ESMTPS id g92si6455253qge.52.2014.04.22.16.35.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Apr 2014 16:35:44 -0700 (PDT) Message-ID: <5356FCC1.6060807@zytor.com> Date: Tue, 22 Apr 2014 16:35:29 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 Subject: Why do we set _PAGE_DIRTY for page tables? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List , Linus Torvalds , "linux-mm@kvack.org" I just noticed this: #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \ _PAGE_ACCESSED | _PAGE_DIRTY) #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \ _PAGE_DIRTY) Is there a reason we set _PAGE_DIRTY for page tables? It has no function, but doesn't do any harm either (the dirty bit is ignored for page tables)... it just looks funny to me. -hpa -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by kanga.kvack.org (Postfix) with ESMTP id 2DAA26B0070 for ; Tue, 22 Apr 2014 22:48:55 -0400 (EDT) Received: by mail-vc0-f182.google.com with SMTP id ib6so389926vcb.41 for ; Tue, 22 Apr 2014 19:48:54 -0700 (PDT) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [2607:f8b0:400c:c01::22a]) by mx.google.com with ESMTPS id at8si7198876vec.199.2014.04.22.19.48.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 19:48:54 -0700 (PDT) Received: by mail-ve0-f170.google.com with SMTP id pa12so412878veb.29 for ; Tue, 22 Apr 2014 19:48:54 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5356FCC1.6060807@zytor.com> References: <5356FCC1.6060807@zytor.com> Date: Tue, 22 Apr 2014 19:48:54 -0700 Message-ID: Subject: Re: Why do we set _PAGE_DIRTY for page tables? From: Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: "H. Peter Anvin" Cc: Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List , "linux-mm@kvack.org" On Tue, Apr 22, 2014 at 4:35 PM, H. Peter Anvin wrote: > I just noticed this: > > #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \ > _PAGE_ACCESSED | _PAGE_DIRTY) > #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \ > _PAGE_DIRTY) > > Is there a reason we set _PAGE_DIRTY for page tables? It has no > function, but doesn't do any harm either (the dirty bit is ignored for > page tables)... it just looks funny to me. I think it just got copied, and at least the A bit does matter even in page tables (well, it gets updated, I don't know how much that "matters"). So the fact that D is ignored is actually the odd man out. Linus -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-f173.google.com (mail-qc0-f173.google.com [209.85.216.173]) by kanga.kvack.org (Postfix) with ESMTP id F38FD6B0070 for ; Tue, 22 Apr 2014 22:51:39 -0400 (EDT) Received: by mail-qc0-f173.google.com with SMTP id r5so349071qcx.4 for ; Tue, 22 Apr 2014 19:51:39 -0700 (PDT) Received: from mail.zytor.com (terminus.zytor.com. [2001:1868:205::10]) by mx.google.com with ESMTPS id gq5si17841624qab.95.2014.04.22.19.51.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Apr 2014 19:51:39 -0700 (PDT) Message-ID: <53572AAA.4070207@zytor.com> Date: Tue, 22 Apr 2014 19:51:22 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 Subject: Re: Why do we set _PAGE_DIRTY for page tables? References: <5356FCC1.6060807@zytor.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List , "linux-mm@kvack.org" On 04/22/2014 07:48 PM, Linus Torvalds wrote: > On Tue, Apr 22, 2014 at 4:35 PM, H. Peter Anvin wrote: >> I just noticed this: >> >> #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \ >> _PAGE_ACCESSED | _PAGE_DIRTY) >> #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \ >> _PAGE_DIRTY) >> >> Is there a reason we set _PAGE_DIRTY for page tables? It has no >> function, but doesn't do any harm either (the dirty bit is ignored for >> page tables)... it just looks funny to me. > > I think it just got copied, and at least the A bit does matter even in > page tables (well, it gets updated, I don't know how much that > "matters"). So the fact that D is ignored is actually the odd man out. > Yes, not setting the A bit means the hardware will take an assist to set the bit for us, which is a waste of time if we don't care about it. The D bit is the one which made me wonder; I thought either it was just copy & paste, or that it got set to make it more analogous with large pages. -hpa -- 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: email@kvack.org