Re: poll-related "scheduling while atomic", 2.5.44-mm6

Andrew Morton
2002-10-30T06:20:54Z

Paolo Ciarrocchi wrote:
>
> >> So my guess is somewhere between -mm5 and -mm6 we
> >> screwed up the atomicity count.
> >Mine too. I'll check it out, thanks.
>
> The same here as well
>

This'll fix it up. Whoever invented cut-n-paste has a lot to
answer for.

--- 25/mm/swap.c~preempt-count-fix Tue Oct 29 22:19:54 2002
+++ 25-akpm/mm/swap.c Tue Oct 29 22:20:16 2002
@@ -90,11 +90,12 @@ void lru_cache_add_active(struct page *p

void lru_add_drain(void)
{
- struct pagevec *pvec = &per_cpu(lru_add_pvecs, get_cpu());
+ int cpu = get_cpu();
+ struct pagevec *pvec = &per_cpu(lru_add_pvecs, cpu);

if (pagevec_count(pvec))
__pagevec_lru_add(pvec);
- pvec = &per_cpu(lru_add_active_pvecs, get_cpu());
+ pvec = &per_cpu(lru_add_active_pvecs, cpu);
if (pagevec_count(pvec))
__pagevec_lru_add_active(pvec);
put_cpu();

.

I had a crash while testing SMP+preempt btw. Nasty one - took a
pagefault from userspace but do_page_fault() decided that the
fault was in-kernel or something. It fell all the way through
to die() and, well, died. I saw the same happen some months ago.