Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1442323 > unrolled thread

Re: [PATCH 3/9] async: Extend kfence to allow struct embedding

Started byPeter Zijlstra <peterz@infradead.org>
First post2016-07-13 12:40 +0200
Last post2016-07-13 12:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3/9] async: Extend kfence to allow struct embedding Peter Zijlstra <peterz@infradead.org> - 2016-07-13 12:40 +0200

#1442323 — Re: [PATCH 3/9] async: Extend kfence to allow struct embedding

FromPeter Zijlstra <peterz@infradead.org>
Date2016-07-13 12:40 +0200
SubjectRe: [PATCH 3/9] async: Extend kfence to allow struct embedding
Message-ID<rUpKb-1QV-33@gated-at.bofh.it>
On Fri, Jun 24, 2016 at 10:08:47AM +0100, Chris Wilson wrote:
> @@ -151,7 +161,11 @@ static void kfence_free(struct kref *kref)
>  
>  	WARN_ON(atomic_read(&fence->pending) > 0);
>  
> -	kfree(fence);
> +	if (fence->flags) {
> +		kfence_notify_t fn = (kfence_notify_t)fence->flags;

Maybe provide an inline helper for that conversion and also mask out the
low bits, just to be careful. You're assuming they're not set here,
which seems like a dangerous thing.

> +		fn(fence);
> +	} else
> +		kfree(fence);

Also Codingstyle wants braces on both branches if its on one.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web