Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750839AbVKJNQq (ORCPT ); Thu, 10 Nov 2005 08:16:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750840AbVKJNQq (ORCPT ); Thu, 10 Nov 2005 08:16:46 -0500 Received: from gold.veritas.com ([143.127.12.110]:36769 "EHLO gold.veritas.com") by vger.kernel.org with ESMTP id S1750839AbVKJNQp (ORCPT ); Thu, 10 Nov 2005 08:16:45 -0500 Date: Thu, 10 Nov 2005 13:15:31 +0000 (GMT) From: Hugh Dickins X-X-Sender: hugh@goblin.wat.veritas.com To: "Michael S. Tsirkin" cc: Gleb Natapov , Benjamin Herrenschmidt , Petr Vandrovec , Nick Piggin , Badari Pulavarty , Linux Kernel Mailing List Subject: Re: Nick's core remove PageReserved broke vmware... In-Reply-To: <20051110124853.GD16589@mellanox.co.il> Message-ID: References: <20051110123538.GL8942@minantech.com> <20051110124853.GD16589@mellanox.co.il> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 10 Nov 2005 13:16:44.0533 (UTC) FILETIME=[FF271A50:01C5E5F8] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1007 Lines: 26 On Thu, 10 Nov 2005, Michael S. Tsirkin wrote: > Quoting Gleb Natapov : > > I think you are removing VM_RAND_READ/VM_SEQ_READ here. Good catch from Gleb, I certainly didn't notice that. > > True, we need something like > > switch (behavior) { > case MADV_SEQUENTIAL: > new_flags = (vma->vm_flags & ~VM_READHINTMASK) | VM_SEQ_READ; > break; > case MADV_RANDOM: > new_flags = (vma->vm_flags & ~VM_READHINTMASK) | VM_RAND_READ; > break; Yes, that helps avoid such errors in future. Though, no strong feelings, but I'd find it clearer to avoid the obscure VM_READHINTMASK completely, and just say (vma->vm_flags & ~VM_RAND_READ) | VM_SEQ_READ etc. Hugh - 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/