Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753890Ab2BGFjU (ORCPT ); Tue, 7 Feb 2012 00:39:20 -0500 Received: from mail-gx0-f174.google.com ([209.85.161.174]:49619 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752117Ab2BGFjS (ORCPT ); Tue, 7 Feb 2012 00:39:18 -0500 MIME-Version: 1.0 In-Reply-To: <20120207042026.GA25524@oksana.dev.rtsoft.ru> References: <20120203163056.GA4190@redhat.com> <20120206162935.GB5117@oksana.dev.rtsoft.ru> <20120207042026.GA25524@oksana.dev.rtsoft.ru> From: KOSAKI Motohiro Date: Tue, 7 Feb 2012 00:38:58 -0500 Message-ID: Subject: Re: [PATCH v2 2/6] oom: Get rid of sparse warnings To: Anton Vorontsov Cc: Oleg Nesterov , Greg KH , =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= , San Mehat , Colin Cross , "Eric W. Biederman" , "Paul E. McKenney" , linux-kernel@vger.kernel.org, kernel-team@android.com, linaro-kernel@lists.linaro.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 25 >> task struct only have allock_lock, not alloc_loc. > > Funnily, but sparse does not care. :-) __release(foo) will work as > well. Seems like sparse counts locking balance globally. > > This is now fixed in the patch down below, thanks for catching. > >> Moreover we don't release >> the lock in this code path. Seems odd. > > Indeed. That's exactly what sparse seeing is as well. We exit > without releasing the lock, which is bad (in sparse' eyes). So > we lie to sparse, telling it that we do release, so it shut ups. Hmmm.... To be honest, I really dislike any lie annotation. Why? It is very fragile and easily become broken from unrelated but near line changes. Please consider to enhance sparse at first. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/