From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:54076 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932239AbeF1JXO (ORCPT ); Thu, 28 Jun 2018 05:23:14 -0400 Date: Thu, 28 Jun 2018 02:23:03 -0700 From: Matthew Wilcox To: Gao Xiang Cc: viro@zeniv.linux.org.uk, Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , Thomas Gleixner , Chao Yu , Miao Xie , linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] : Introduce tagged pointer Message-ID: <20180628092303.GD7646@bombadil.infradead.org> References: <1530176789-107541-1-git-send-email-gaoxiang25@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530176789-107541-1-git-send-email-gaoxiang25@huawei.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jun 28, 2018 at 05:06:29PM +0800, Gao Xiang wrote: > Therefore, this patch introduces simple generic methods to fold > tags into a pointer integer. It currently reuses the last 2 bits > of the pointer for tags, which are safely for all modern platforms. The m68k people will have your head. alignof(unsigned long) == 2 on m68k. Now, kmalloc always returns 8-byte aligned quantities, but if you have: static unsigned long foo; then ((unsigned long)&foo & 2) may be non-zero. > +/* > + * mark these special integers as another type > + * in order to highlight the tagged pointer usage. > + */ > +typedef uintptr_t taggedptr_t; I find this a bit verbose. How about tagptr_t ?