Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262972AbUFBO22 (ORCPT ); Wed, 2 Jun 2004 10:28:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262974AbUFBO22 (ORCPT ); Wed, 2 Jun 2004 10:28:28 -0400 Received: from mail.fh-wedel.de ([213.39.232.194]:10632 "EHLO mail.fh-wedel.de") by vger.kernel.org with ESMTP id S262972AbUFBO2Z (ORCPT ); Wed, 2 Jun 2004 10:28:25 -0400 Date: Wed, 2 Jun 2004 16:27:48 +0200 From: =?iso-8859-1?Q?J=F6rn?= Engel To: Linus Torvalds Cc: Horst von Brand , Pavel Machek , Andrew Morton , Arjan van de Ven , Ingo Molnar , Andrea Arcangeli , Rik van Riel , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] explicitly mark recursion count Message-ID: <20040602142748.GA25939@wohnheim.fh-wedel.de> References: <200406011929.i51JTjGO006174@eeyore.valparaiso.cl> <20040602131623.GA23017@wohnheim.fh-wedel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.3.28i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1526 Lines: 52 On Wed, 2 June 2004 07:15:07 -0700, Linus Torvalds wrote: > On Wed, 2 Jun 2004, J?rn Engel wrote: > > > > For a->b->c->a type recursions, I also need to identify all involved > > functions in the correct order, that's where my ugly format comes > > from. > > Why? > > You really only need to know that _one_ of the entries break the > recursion, and you need to know what the break depth is for that one > entry. > > So for example, if "c" is annotated with "max recursion: 5", then you know > that the above loop will recurse at most 5 times. > > I don't see why you need any other information. Then you see something I don't see. For example there are quite a few recursions with some function like void foo(int depth) { if (!depth) { bar(1); } ... } bar will, maybe through several more functions call foo(1). How can you say that foo will beak this recursion after two rounds max? What if a changed bar decrements the depth value? The recursion will run for infinity now, won't it? And whoever changed bar doesn't have a clue that he now fucked up your comment to foo. I claim: There is no way to tell the depth of any recursion without looking at all involved functions. Prove me wrong, please. J?rn -- When in doubt, use brute force. -- Ken Thompson - 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/