From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030315AbVHKOCi (ORCPT ); Thu, 11 Aug 2005 10:02:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030318AbVHKOCi (ORCPT ); Thu, 11 Aug 2005 10:02:38 -0400 Received: from gold.veritas.com ([143.127.12.110]:42921 "EHLO gold.veritas.com") by vger.kernel.org with ESMTP id S1030315AbVHKOCh (ORCPT ); Thu, 11 Aug 2005 10:02:37 -0400 Date: Thu, 11 Aug 2005 15:04:29 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@goblin.wat.veritas.com To: Gleb Natapov cc: "Michael S. Tsirkin" , Roland Dreier , linux-kernel@vger.kernel.org, openib-general@openib.org Subject: Re: [openib-general] Re: [PATCH repost] PROT_DONTCOPY: ifiniband uverbs fork support In-Reply-To: <20050811080205.GR16361@minantech.com> Message-ID: References: <20050719165542.GB16028@mellanox.co.il> <20050725171928.GC12206@mellanox.co.il> <20050726133553.GA22276@mellanox.co.il> <20050810083943.GM16361@minantech.com> <20050810132611.GP16361@minantech.com> <20050811080205.GR16361@minantech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 11 Aug 2005 14:02:35.0150 (UTC) FILETIME=[530EB2E0:01C59E7D] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Aug 2005, Gleb Natapov wrote: > What about the idea that was floating around about new VM flag that will > instruct kernel to copy pages belonging to the vma on fork instead of mark > them as cow? It's a pretty good idea, and thanks for reminding us of it. It suffers from the general difficulty with fixes within get_user_pages, that we need down_write(&mm->mmap_sem) to split_vma, and even just to update vm_flags, whereas get_user_pages is entered with down_read. Really, we'd prefer not to mess with the vma itself in get_user_pages. Could mark the ptes instead, perhaps, but that gets very architecture- dependent. A separate array? not so nice if the vma is very large and the get_user_pages area very small. I had toyed with leaving the ptes in the parent as writable, made readonly just in the child; but though that violation could be excused while get_user_pages is active, it would have to be corrected at the end, and that gets complicated again. Hugh