Re: Another Ndis MinportXXX question

From: Pavel A. (pavel_a_at_NOwritemeNO.com)
Date: 01/16/05


Date: Sun, 16 Jan 2005 09:35:02 -0800

Arkady Frenkel wrote:
> Correct , reentrancy can be supported but not in the same context
> Arkady

This is what I called RECURSION earlier - as opposite to REENTRANCY.
It occurs in the same "context" (same thread, same CPU).

--PA
 
> "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> news:#DxA1Yp9EHA.1392@tk2msftngp13.phx.gbl...
> > With a spinlock, a deadlock occures just by acquiring the same lock second
> > time in the same context.
> >
> > "Pavel A." <pavel_a@NOwritemeNO.com> wrote in message
> > news:eqtQENo9EHA.2316@TK2MSFTNGP15.phx.gbl...
> > > No, *I* can (of course, not by raising irql alone).
> > > It *is* possible to handle reentrancy. The only real problem here
> > > (as Alireza. pointed out) boils down to possibility of deadlock, when
> > > a. Two or more locks are acquired in the code path;
> > > b. Another path exists that acquires same locks in reverse order.
> > > Now I'm trying to understand, are there other ways for NDIS miniport
> > > to raise to dispatch, besides acquiring a spinlock.
> > >
> > > --PA
> > >
> > > "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> > > news:u4qTQOm9EHA.2680@TK2MSFTNGP09.phx.gbl...
> > >> You cannot sync between passive and DPC by raising IRQL.
> > >> In your protected code sections, you should not call any external
> > >> functions
> > >> that can cause reentrancy.
> > >>
> > >> "Pavel A." <pavel_a@NOwritemeNO.com> wrote in message
> > >> news:6E11725C-3DE1-4661-AAD6-927F4A8B4A74@microsoft.com...
> > >> > "Alireza Dabagh [MS]" wrote:
> > >> >> Without going through details below, I want to point out that if you
> > >> >> use
> > >> >> a
> > >> >> flag that by checking it you could figure out if it is safe to call
> > >> >> NDIS
> > >> >> or
> > >> >> not, you could use the same flag for protecting whatever it is that
> > >> >> you
> > >> >> want
> > >> >> to protect by holding the spinlock. This is why I said by the time
> you
> > >> >> put
> > >> >> the safeguard in, you can end up with a situation that you don't
> need
> > >> >> to
> > >> >> acquire the spinlock.
> > >> >
> > >> > Ali, could you please explain how we can do this without spinlock.
> > >> > When I need to sync between passive and DPCs, I have to get to
> > >> > dispatch.
> > >> > But NDIS spinlock seems to be the only way to raise to dispatch -
> > >> > KeRaiseIrql is forbidden?
> > >> >
> > >> > Thanks
> > >> > Pavel
> > >> >
> > >>
> > >>
> > >
> > >
> >
> >
>
>
>



Relevant Pages

  • Re: [PATCH 2/2] tracing/events/lockdep: move tracepoints within recursive protection
    ... it allows one event to trace within another event. ... But surely not in the same context. ... You could do a 4 level recursion ... Why not allow a nested interrupt to trace? ...
    (Linux-Kernel)
  • Re: Why do lisps have stack limits?
    ... have as its implication that stack limits were bad, ... reasons for wanting deep recursion, and for this one can just write a ... pre-allocate lots of stack (for other implementations). ... context of resource limitations. ...
    (comp.lang.lisp)
  • Re: bash vs ksh problem
    ... Using the ksh this simple test program ... which a token is used can coerce it to that context. ... the recursion limit is reached. ... However on RH Linux using bash ...
    (comp.unix.shell)
  • Re: [PATCH 2/2] tracing/events/lockdep: move tracepoints within recursive protection
    ... it allows one event to trace within another event. ... But surely not in the same context. ... You could do a 4 level recursion ... protection like I did in perf-counter, ...
    (Linux-Kernel)
  • Re: Scope Question
    ... The number one solution is to split the recursion into a non-recursive ... ;; can freely refer to context ... set up the binding is to split the function into the interface wrapper ... (defun foo-recursion-helper (input) ...
    (comp.lang.lisp)