Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756861AbYJRA1e (ORCPT ); Fri, 17 Oct 2008 20:27:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752299AbYJRA1Z (ORCPT ); Fri, 17 Oct 2008 20:27:25 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:57509 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751789AbYJRA1Z (ORCPT ); Fri, 17 Oct 2008 20:27:25 -0400 Date: Fri, 17 Oct 2008 17:25:26 -0700 (PDT) From: Linus Torvalds To: Hugh Dickins cc: Nick Piggin , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm: fix anon_vma races In-Reply-To: Message-ID: References: <20081016041033.GB10371@wotan.suse.de> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1616 Lines: 43 On Sat, 18 Oct 2008, Hugh Dickins wrote: > > But they're doing it to make the page's ptes accessible to > memory reclaim, and the CPU doing memory reclaim will not > (unless by coincidence) have done that anon_vma_prepare() - > it's just reading the links which the faulters are providing. Ahh. Good point. Then yes, those ones would really need the smp_read_barrier_depends() too. Very annoying. Of course, we _could_ just admit that the situation is really *really* unlikely, and there are probably something like five people running Linux/alpha, and that we don't care enough. With just the smp_wmb(), we cover all non-alpha people, since this is all through a pointer, so all the readers will inevitably be of the smp_read_barrier_depends kind. If we want to guarantee the proper smp_read_barrier_depends() behaviour, then we'd need to find them all. Possibly by renaming the whole field (prepend an underscore like we usually do) and forcing all readers to use some "get_anon_vma(vma)" helper function, aka static inline struct anon_vma *get_anon_vma(struct vm_area_struct *vma) { struct anon_vma *anon_vma = vma->_anon_vma; smp_read_barrier_depends(); return anon_vma; } which would find them all. Ugh. I really would have preferred not having something like that. Especially considering how limited that issue really is. Hmm. 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/