Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754647AbaJBQBk (ORCPT ); Thu, 2 Oct 2014 12:01:40 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:49160 "EHLO mail-vc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752864AbaJBQBj (ORCPT ); Thu, 2 Oct 2014 12:01:39 -0400 MIME-Version: 1.0 In-Reply-To: <20141002142503.GA13203@node.dhcp.inet.fi> References: <20140930164047.GA18354@redhat.com> <20140930182059.GA24431@redhat.com> <542C7B5E.2020000@oracle.com> <20141002142503.GA13203@node.dhcp.inet.fi> Date: Thu, 2 Oct 2014 09:01:38 -0700 X-Google-Sender-Auth: rqW9j05c6u66Hif3SN14ZwI0N9g Message-ID: Subject: Re: pipe/page fault oddness. From: Linus Torvalds To: "Kirill A. Shutemov" Cc: Sasha Levin , Hugh Dickins , Dave Jones , Al Viro , Linux Kernel , Rik van Riel , Ingo Molnar , Michel Lespinasse , "Kirill A. Shutemov" , Mel Gorman Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 2, 2014 at 7:25 AM, Kirill A. Shutemov wrote: > > I don't see what prevents the code to make zero page writable here. > We need at least pmd = pmd_wrprotect(pmd) before set_pmd_at(); Do we? If it's the zero page, it had better be an anonymous mapping, and vm_page_prot had better not be writable. Anonymous pages don't _start_ out writable, we explicitly make them so with code like if (vma->vm_flags & VM_WRITE) entry = pte_mkwrite(pte_mkdirty(entry)); so it should be fine to just use "pmd_modify(pmd, vma->vm_page_prot);" directly. But hey, this is the kind of thing that maybe I'm missing something on.. 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/