From: Tejun Heo <tj@kernel.org>
To: Christoph Lameter <cl@linux.com>
Cc: Dmitry Antipov <dmitry.antipov@linaro.org>,
Rusty Russell <rusty@rustcorp.com.au>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
patches@linaro.org, linaro-dev@lists.linaro.org
Subject: Re: [PATCH 1/3] percpu: use ZERO_SIZE_PTR / ZERO_OR_NULL_PTR
Date: Mon, 30 Jan 2012 09:54:34 -0800 [thread overview]
Message-ID: <20120130175434.GG3355@google.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1201301145570.28693@router.home>
Hello, Christoph.
On Mon, Jan 30, 2012 at 11:52:23AM -0600, Christoph Lameter wrote:
> We have two possibilities now:
>
> 1. We say that the value returned from the per cpu allocator is an opaque
> value.
>
> This means that we have to remove the NULL check from the free
> function. And audit the kernel code for all occurrences where
> a per cpu pointer value of NULL is assumed to mean that no per
> cpu allocation has occurred.
No, NULL is never gonna be a valid return from any allocator including
percpu. Percpu allocator doesn't and will never do so.
> 2. We say that there are special values for the per cpu pointers (NULL,
> ZERO_SIZE_PTR)
>
> Then we would have to guarantee that the per cpu allocator never
> returns those values.
>
> Plus then the ZERO_SIZE_PTR patch will be fine.
>
> The danger exist of these values being passed as
> parameters to functions that do not support them (per_cpu_ptr
> etc). Those would need VM_BUG_ONs or some other checks to detect
> potential problems.
I'm saying we don't have this for ZERO_SIZE_PTR in any meaningful way
at this point. If somebody wants to implement it properly, please
feel free to, but simply applying ZERO_SIZE_PTR without other changes
doesn't make any sense.
Thanks.
--
tejun
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: Christoph Lameter <cl@linux.com>
Cc: Dmitry Antipov <dmitry.antipov@linaro.org>,
Rusty Russell <rusty@rustcorp.com.au>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
patches@linaro.org, linaro-dev@lists.linaro.org
Subject: Re: [PATCH 1/3] percpu: use ZERO_SIZE_PTR / ZERO_OR_NULL_PTR
Date: Mon, 30 Jan 2012 09:54:34 -0800 [thread overview]
Message-ID: <20120130175434.GG3355@google.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1201301145570.28693@router.home>
Hello, Christoph.
On Mon, Jan 30, 2012 at 11:52:23AM -0600, Christoph Lameter wrote:
> We have two possibilities now:
>
> 1. We say that the value returned from the per cpu allocator is an opaque
> value.
>
> This means that we have to remove the NULL check from the free
> function. And audit the kernel code for all occurrences where
> a per cpu pointer value of NULL is assumed to mean that no per
> cpu allocation has occurred.
No, NULL is never gonna be a valid return from any allocator including
percpu. Percpu allocator doesn't and will never do so.
> 2. We say that there are special values for the per cpu pointers (NULL,
> ZERO_SIZE_PTR)
>
> Then we would have to guarantee that the per cpu allocator never
> returns those values.
>
> Plus then the ZERO_SIZE_PTR patch will be fine.
>
> The danger exist of these values being passed as
> parameters to functions that do not support them (per_cpu_ptr
> etc). Those would need VM_BUG_ONs or some other checks to detect
> potential problems.
I'm saying we don't have this for ZERO_SIZE_PTR in any meaningful way
at this point. If somebody wants to implement it properly, please
feel free to, but simply applying ZERO_SIZE_PTR without other changes
doesn't make any sense.
Thanks.
--
tejun
next prev parent reply other threads:[~2012-01-30 17:54 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-30 8:37 [PATCH 1/3] percpu: use ZERO_SIZE_PTR / ZERO_OR_NULL_PTR Dmitry Antipov
2012-01-30 8:37 ` Dmitry Antipov
2012-01-30 16:15 ` Christoph Lameter
2012-01-30 16:15 ` Christoph Lameter
2012-01-30 17:15 ` Tejun Heo
2012-01-30 17:15 ` Tejun Heo
2012-01-30 17:19 ` Tejun Heo
2012-01-30 17:19 ` Tejun Heo
2012-01-30 17:22 ` Christoph Lameter
2012-01-30 17:22 ` Christoph Lameter
2012-01-30 17:33 ` Tejun Heo
2012-01-30 17:33 ` Tejun Heo
2012-01-30 17:35 ` Christoph Lameter
2012-01-30 17:35 ` Christoph Lameter
2012-01-30 17:22 ` Christoph Lameter
2012-01-30 17:22 ` Christoph Lameter
2012-01-30 17:42 ` Tejun Heo
2012-01-30 17:42 ` Tejun Heo
2012-01-30 17:52 ` Christoph Lameter
2012-01-30 17:52 ` Christoph Lameter
2012-01-30 17:54 ` Tejun Heo [this message]
2012-01-30 17:54 ` Tejun Heo
2012-01-30 17:58 ` Christoph Lameter
2012-01-30 17:58 ` Christoph Lameter
2012-01-30 18:02 ` Tejun Heo
2012-01-30 18:02 ` Tejun Heo
2012-01-30 18:12 ` Christoph Lameter
2012-01-30 18:12 ` Christoph Lameter
2012-01-30 18:16 ` Tejun Heo
2012-01-30 18:16 ` Tejun Heo
2012-01-31 4:48 ` Rusty Russell
2012-01-31 4:48 ` Rusty Russell
2012-01-30 18:13 ` Tejun Heo
2012-01-30 18:13 ` Tejun Heo
2012-01-30 18:15 ` Christoph Lameter
2012-01-30 18:15 ` Christoph Lameter
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=20120130175434.GG3355@google.com \
--to=tj@kernel.org \
--cc=cl@linux.com \
--cc=dmitry.antipov@linaro.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=patches@linaro.org \
--cc=rusty@rustcorp.com.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.