Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752505AbbEGRnI (ORCPT ); Thu, 7 May 2015 13:43:08 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:35912 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbbEGRnE (ORCPT ); Thu, 7 May 2015 13:43:04 -0400 MIME-Version: 1.0 In-Reply-To: References: <20150506200219.40425.74411.stgit@dwillia2-desk3.amr.corp.intel.com> Date: Thu, 7 May 2015 10:43:01 -0700 X-Google-Sender-Auth: QYpMNjQvehk-9ECXB73aykFiDG4 Message-ID: Subject: Re: [PATCH v2 00/10] evacuate struct page from the block layer, introduce __pfn_t From: Linus Torvalds To: Dan Williams Cc: Linux Kernel Mailing List , Boaz Harrosh , Jan Kara , Mike Snitzer , Neil Brown , Benjamin Herrenschmidt , Dave Hansen , Heiko Carstens , Chris Mason , Paul Mackerras , "H. Peter Anvin" , Christoph Hellwig , Alasdair Kergon , "linux-nvdimm@lists.01.org" , Ingo Molnar , Mel Gorman , Matthew Wilcox , Ross Zwisler , Rik van Riel , Martin Schwidefsky , Jens Axboe , "Theodore Ts'o" , "Martin K. Petersen" , Julia Lawall , Tejun Heo , linux-fsdevel , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1251 Lines: 26 On Thu, May 7, 2015 at 9:03 AM, Dan Williams wrote: > > Ok, I'll keep thinking about this and come back when we have a better > story about passing mmap'd persistent memory around in userspace. Ok. And if we do decide to go with your kind of "__pfn" type, I'd probably prefer that we encode the type in the low bits of the word rather than compare against PAGE_OFFSET. On some architectures PAGE_OFFSET is zero (admittedly probably not ones you'd care about), but even on x86 it's a *lot* cheaper to test the low bit than it is to compare against a big constant. We know "struct page *" is supposed to be at least aligned to at least "unsigned long", so you'd have two bits of type information (and we could easily make it three). With "0" being a real pointer, so that you can use the pointer itself without masking. And the "hide type in low bits of pointer" is something we've done quite a lot, so it's more "kernel coding style" anyway. 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/