From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbWBMHNW (ORCPT ); Mon, 13 Feb 2006 02:13:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751182AbWBMHNW (ORCPT ); Mon, 13 Feb 2006 02:13:22 -0500 Received: from smtp.osdl.org ([65.172.181.4]:36004 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751109AbWBMHNV (ORCPT ); Mon, 13 Feb 2006 02:13:21 -0500 Date: Sun, 12 Feb 2006 23:12:23 -0800 From: Andrew Morton To: "David S. Miller" Cc: hugh@veritas.com, wli@holomorphy.com, nickpiggin@yahoo.com.au, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] compound page: use page[1].lru Message-Id: <20060212231223.773d76ea.akpm@osdl.org> In-Reply-To: <20060212.230516.86740481.davem@davemloft.net> References: <20060212135457.2a3d3b37.akpm@osdl.org> <20060212181312.11392d12.akpm@osdl.org> <20060212.230516.86740481.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org "David S. Miller" wrote: > > From: Andrew Morton > Date: Sun, 12 Feb 2006 18:13:12 -0800 > > > We have a page which has no ->mapping, but lo, it's mmapped by userspace > > and can be MAP_SHARED between different CPUs and processes. > > > > Yes, I suspect it'll do the wrong thing in unpleasantly subtle ways. > > > > (cc's davem and runs away). > > The ->mapping check is there essentially to hit user mapped pages that > would be modified by the kernel using kernel space memory accesses > other than those done by copy_user_page() and clear_user_page() (and > their brothers copy_user_highpage() and clear_user_highpage() which > just call the former directly on a non-HIGHPAGE platform like > sparc64). The direct-io.c code just does memset. (That's very common - maybe clear_user_highpage_partial() is needed?) > Hugepages actually have no D-cache aliasing issues by definition on > sparc64 because the smallest possible hugepage size is 64K which is > larger than the D-cache aliasing factor (which is 16K). OK.. So it would be a bug, except for this hardware quirk. I'll check the other architectures.