From: Matthew Wilcox <willy@infradead.org>
To: Gao Xiang <gaoxiang25@huawei.com>
Cc: viro@zeniv.linux.org.uk,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kate Stewart <kstewart@linuxfoundation.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
Thomas Gleixner <tglx@linutronix.de>,
Chao Yu <yuchao0@huawei.com>, Miao Xie <miaoxie@huawei.com>,
linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] <linux/taggedptr.h>: Introduce tagged pointer
Date: Thu, 28 Jun 2018 02:23:03 -0700 [thread overview]
Message-ID: <20180628092303.GD7646@bombadil.infradead.org> (raw)
In-Reply-To: <1530176789-107541-1-git-send-email-gaoxiang25@huawei.com>
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 ?
next prev parent reply other threads:[~2018-06-28 9:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 9:06 [RFC PATCH] <linux/taggedptr.h>: Introduce tagged pointer Gao Xiang
2018-06-28 9:23 ` Matthew Wilcox [this message]
2018-06-28 9:40 ` Gao Xiang
2018-06-28 14:17 ` [RFC PATCH v2] <linux/tagptr.h>: " Gao Xiang
2018-06-28 15:02 ` [RFC PATCH RESEND v3] " Gao Xiang
2018-06-30 9:47 ` [RFC PATCH v4] " Gao Xiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180628092303.GD7646@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=gaoxiang25@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=pombredanne@nexb.com \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
--cc=yuchao0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).