Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261668AbUDHLLE (ORCPT ); Thu, 8 Apr 2004 07:11:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261677AbUDHLLD (ORCPT ); Thu, 8 Apr 2004 07:11:03 -0400 Received: from ecbull20.frec.bull.fr ([129.183.4.3]:56206 "EHLO ecbull20.frec.bull.fr") by vger.kernel.org with ESMTP id S261668AbUDHLLA (ORCPT ); Thu, 8 Apr 2004 07:11:00 -0400 Message-ID: <4075333B.4C90934C@nospam.org> Date: Thu, 08 Apr 2004 13:10:51 +0200 From: Zoltan Menyhart Reply-To: Zoltan.Menyhart@bull.net Organization: Bull S.A. X-Mailer: Mozilla 4.78 [en] (X11; U; AIX 4.3) X-Accept-Language: fr, en MIME-Version: 1.0 To: David Gibson CC: Andrew Morton , linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Anton Blanchard , Paul Mackerras , linuxppc64-dev@lists.linuxppc.org Subject: Re: RFC: COW for hugepages References: <20040407074239.GG18264@zax> <4073C33B.7B7808E7@nospam.org> <20040408015327.GB20320@zax> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1272 Lines: 40 David Gibson wrote: > > Why not just add a flag for a VMA telling if you want / do not want to > > copy it on "fork()" ? E.g.: > > > > dup_mmap(): > > > > for (mpnt = current->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) { > > > > if (mpnt->vm_flags & VM_HUGETLB_DONT_COPY) > > > > } > > > > Um.. why would that be useful? I think there are 2 major cases: - A big hugepage-using program creates threads to take advantage of all of the CPUs => use clone2(...CLONEVM...), it works today. - Another big hugepage-using program calling a little shell function with system() => just skip the VMA of the huge page area in do_fork(): copy_process(): copy_mm(): dup_mmap() The child will have no copy of the huge page area. No problem, it will exec() soon, and the stack, the usual data, the malloc()'ed data, etc. are not in the huge page area => exec() will will work correctly. I do not think we need a COW of the huge pages. Regards, Zolt?n Menyh?rt - 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/