From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757886AbYDBOpA (ORCPT ); Wed, 2 Apr 2008 10:45:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755878AbYDBOow (ORCPT ); Wed, 2 Apr 2008 10:44:52 -0400 Received: from mx1.redhat.com ([66.187.233.31]:55511 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754734AbYDBOow (ORCPT ); Wed, 2 Apr 2008 10:44:52 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <8bd0f97a0804011434r4869fbe8t89ade12c04c97f2@mail.gmail.com> References: <8bd0f97a0804011434r4869fbe8t89ade12c04c97f2@mail.gmail.com> To: "Mike Frysinger" Cc: dhowells@redhat.com, "Greg Ungerer" , "David McCullough" , LKML , "Bryan Wu" , "Bernd Schmidt" , "Robin Getz" Subject: Re: nommu: handling anonymous mmap clearing in userspace rather than kernel X-Mailer: MH-E 8.0.3+cvs; nmh 1.2-20070115cvs; GNU Emacs 23.0.50 Date: Wed, 02 Apr 2008 15:20:14 +0100 Message-ID: <5516.1207146014@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mike Frysinger wrote: > a workaround: introduce a new no-mmu-only mmap flag MAP_UNINITIALIZE > to signal to the kernel that it should skip the memset(). this way, > userspace malloc() can do mmap(MAP_ANONYMOUS|MAP_UNINITIALIZE) to get > large chunks of memory without affecting any other anonymous mmap() > call. I think that's reasonable for NOMMU. It's not like the process accessing the uninitialised memory is prevented from accessing anything it wants to anyway. I would vote that the memset() should only be skipped if requested as there may be programs that call mmap(MAP_ANONYMOUS) expecting the memory they're given to be zeroed out. David