lkml.org 
[lkml]   [2003]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Worst recursion in the kernel
    On Wed, Dec 03, 2003 at 08:04:40PM +0100, Jörn Engel wrote:
    >
    > You are right, verify_cis_cache() does not belong into the list.
    > Gotta see where that bug comes from. set_cis_map() is correct,
    > though. It does call validate_mem(), at least in my copy of
    > 2.6.0-test11:

    Oh, so it does; I was looking at the older version I wrote.

    > I have no better alternative availlable right now, but there must be
    > another way. Maybe something like this:
    >
    > read_cis_mem() {
    > if (__read_cis_mem() != -EAGAIN)
    > return;
    > validate_mem();
    > __read_cis_mem();
    > }

    The issue is that validate_mem() doesn't need to use read_cis_mem's
    functionality directly (so it can't just be modified to use the __*
    form). It calls other stuff, which calls other stuff, which
    eventually calls read_cis_mem(), and all that other stuff is used by
    other callers. So there isn't an obvious place to insert this
    bifurcation.

    > Not sure about you, but it would make my program much happier. If you
    > look at the relevant part of the call graph (below), you will notice
    > that inv_probe() alone is already recursive. Having multiple
    > recursions to worry about in the same function is where the problem
    > stops being difficult and becomes impossible.

    inv_probe() is pretty comprehensible, it calls itself directly, in
    order to traverse a short linked list from tail to head.

    -- Dave
    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:59    [W:0.026 / U:126.328 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site