From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Date: Sat, 24 Mar 2012 16:43:27 +0000 Subject: Re: [PATCH 10/10] oom: Make find_lock_task_mm() sparse-aware Message-Id: <1332607407.16159.51.camel@twins> List-Id: References: <20120324102609.GA28356@lizard> <20120324103127.GJ29067@lizard> <1332593574.16159.31.camel@twins> <20120324162151.GA3640@lizard> In-Reply-To: <20120324162151.GA3640@lizard> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org On Sat, 2012-03-24 at 20:21 +0400, Anton Vorontsov wrote: > Just wonder how do you see the feature implemented? > > Something like this? > > #define __ret_cond_locked(l, c) __attribute__((ret_cond_locked(l, c))) > #define __ret_value __attribute__((ret_value)) > #define __ret_locked_nonnull(l) __ret_cond_locked(l, __ret_value); > > extern struct task_struct *find_lock_task_mm(struct task_struct *p) > __ret_locked_nonnull(&__ret_value->alloc_lock); Yeah, see the email I just CC'ed you on to linux-sparse. Basically extend __attribute__((context())) to allow things similar to what you proposed. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <1332607407.16159.51.camel@twins> From: Peter Zijlstra Date: Sat, 24 Mar 2012 17:43:27 +0100 In-Reply-To: <20120324162151.GA3640@lizard> References: <20120324102609.GA28356@lizard> <20120324103127.GJ29067@lizard> <1332593574.16159.31.camel@twins> <20120324162151.GA3640@lizard> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Subject: Re: [PATCH 10/10] oom: Make find_lock_task_mm() sparse-aware To: Anton Vorontsov Cc: Andrew Morton , Oleg Nesterov , Russell King , Mike Frysinger , Benjamin Herrenschmidt , Richard Weinberger , Paul Mundt , KOSAKI Motohiro , John Stultz , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, uclinux-dist-devel@blackfin.uclinux.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, linux-mm@kvack.org, Linus Torvalds List-ID: On Sat, 2012-03-24 at 20:21 +0400, Anton Vorontsov wrote: > Just wonder how do you see the feature implemented? > > Something like this? > > #define __ret_cond_locked(l, c) __attribute__((ret_cond_locked(l, c))) > #define __ret_value __attribute__((ret_value)) > #define __ret_locked_nonnull(l) __ret_cond_locked(l, __ret_value); > > extern struct task_struct *find_lock_task_mm(struct task_struct *p) > __ret_locked_nonnull(&__ret_value->alloc_lock); Yeah, see the email I just CC'ed you on to linux-sparse. Basically extend __attribute__((context())) to allow things similar to what you proposed. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9D8BDB6EF1 for ; Sun, 25 Mar 2012 03:43:57 +1100 (EST) Message-ID: <1332607407.16159.51.camel@twins> Subject: Re: [PATCH 10/10] oom: Make find_lock_task_mm() sparse-aware From: Peter Zijlstra To: Anton Vorontsov Date: Sat, 24 Mar 2012 17:43:27 +0100 In-Reply-To: <20120324162151.GA3640@lizard> References: <20120324102609.GA28356@lizard> <20120324103127.GJ29067@lizard> <1332593574.16159.31.camel@twins> <20120324162151.GA3640@lizard> Content-Type: text/plain; charset="ISO-8859-1" Mime-Version: 1.0 Cc: Mike Frysinger , user-mode-linux-devel@lists.sourceforge.net, linux-sh@vger.kernel.org, Richard Weinberger , linuxppc-dev@lists.ozlabs.org, Oleg Nesterov , Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Mundt , John Stultz , KOSAKI Motohiro , Russell King , Andrew Morton , uclinux-dist-devel@blackfin.uclinux.org, linux-arm-kernel@lists.infradead.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sat, 2012-03-24 at 20:21 +0400, Anton Vorontsov wrote: > Just wonder how do you see the feature implemented? >=20 > Something like this? >=20 > #define __ret_cond_locked(l, c) __attribute__((ret_cond_locked(l, c))) > #define __ret_value __attribute__((ret_value)) > #define __ret_locked_nonnull(l) __ret_cond_locked(l, __ret_value); >=20 > extern struct task_struct *find_lock_task_mm(struct task_struct *p) > __ret_locked_nonnull(&__ret_value->alloc_lock); Yeah, see the email I just CC'ed you on to linux-sparse. Basically extend __attribute__((context())) to allow things similar to what you proposed. From mboxrd@z Thu Jan 1 00:00:00 1970 From: a.p.zijlstra@chello.nl (Peter Zijlstra) Date: Sat, 24 Mar 2012 17:43:27 +0100 Subject: [PATCH 10/10] oom: Make find_lock_task_mm() sparse-aware In-Reply-To: <20120324162151.GA3640@lizard> References: <20120324102609.GA28356@lizard> <20120324103127.GJ29067@lizard> <1332593574.16159.31.camel@twins> <20120324162151.GA3640@lizard> Message-ID: <1332607407.16159.51.camel@twins> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sat, 2012-03-24 at 20:21 +0400, Anton Vorontsov wrote: > Just wonder how do you see the feature implemented? > > Something like this? > > #define __ret_cond_locked(l, c) __attribute__((ret_cond_locked(l, c))) > #define __ret_value __attribute__((ret_value)) > #define __ret_locked_nonnull(l) __ret_cond_locked(l, __ret_value); > > extern struct task_struct *find_lock_task_mm(struct task_struct *p) > __ret_locked_nonnull(&__ret_value->alloc_lock); Yeah, see the email I just CC'ed you on to linux-sparse. Basically extend __attribute__((context())) to allow things similar to what you proposed. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx161.postini.com [74.125.245.161]) by kanga.kvack.org (Postfix) with SMTP id 50EE66B0044 for ; Sat, 24 Mar 2012 12:43:48 -0400 (EDT) Message-ID: <1332607407.16159.51.camel@twins> Subject: Re: [PATCH 10/10] oom: Make find_lock_task_mm() sparse-aware From: Peter Zijlstra Date: Sat, 24 Mar 2012 17:43:27 +0100 In-Reply-To: <20120324162151.GA3640@lizard> References: <20120324102609.GA28356@lizard> <20120324103127.GJ29067@lizard> <1332593574.16159.31.camel@twins> <20120324162151.GA3640@lizard> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Anton Vorontsov Cc: Andrew Morton , Oleg Nesterov , Russell King , Mike Frysinger , Benjamin Herrenschmidt , Richard Weinberger , Paul Mundt , KOSAKI Motohiro , John Stultz , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, uclinux-dist-devel@blackfin.uclinux.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, linux-mm@kvack.org, Linus Torvalds On Sat, 2012-03-24 at 20:21 +0400, Anton Vorontsov wrote: > Just wonder how do you see the feature implemented? >=20 > Something like this? >=20 > #define __ret_cond_locked(l, c) __attribute__((ret_cond_locked(l, c))) > #define __ret_value __attribute__((ret_value)) > #define __ret_locked_nonnull(l) __ret_cond_locked(l, __ret_value); >=20 > extern struct task_struct *find_lock_task_mm(struct task_struct *p) > __ret_locked_nonnull(&__ret_value->alloc_lock); Yeah, see the email I just CC'ed you on to linux-sparse. Basically extend __attribute__((context())) to allow things similar to what you proposed. -- 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: email@kvack.org