Re: [PATCH 1/2] rcu: cosmetic, delete wrong comment, use HARDIRQ_OFFSET

From: Dipankar Sarma
Date: Sun Nov 28 2004 - 10:41:15 EST


On Sun, Nov 28, 2004 at 04:24:39PM +0100, Manfred Spraul wrote:
> Dipankar Sarma wrote:
>
> >On Sun, Nov 28, 2004 at 06:06:52PM +0300, Oleg Nesterov wrote:
> >
> >
> >>Afaics, this comment is misleading. rcu_check_quiescent_state()
> >>is executed in softirq context, while rcu_check_callbacks() checks
> >>in_softirq() before ++qsctr.
> >>
> >>Also, replace (1 << HARDIRQ_SHIFT) by HARDIRQ_OFFSET.
> >>
> >>
> >>
> >
> >Looks good to me. IIRC, that comment has been around since very
> >early prototypes, so it is probably leftover trash.
> >
> >
> >
> I agree. I think I only moved it around.
> But I don't like the HARDIRQ_OFFSET change. If I understand the code
> correctly it checks that there is no hardirq reentrancy, i.e. the count
> is 0 or 1. Shifted to the appropriate position for the actual test.
> I'd either leave it as it is or use "1*HARDIRQ_OFFSET" - otherwise the
> information that the count should be less of equal one is lost.

Hmm. I agree with Manfred. hardirq_count() <= (1 << HARDIRQ_SHIFT)
was the test I arrived at since it was most explicit - One level
of (local timer) interrupt over idle task and no softirq in between
is OK to indicate that the cpu had seen an idle task. A bigger
hardirq_count() indicates reentrant hardirq over idle task and we
are no longer safe.

So, let's drop the HARDIRQ_OFFSET change.

Thanks
Dipankar
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/