Re: swappiness=0 makes software suspend fail.

From: Pavel Machek
Date: Mon May 31 2004 - 03:43:30 EST


Hi!

> > --- clean/mm/vmscan.c 2004-05-20 23:08:37.000000000 +0200
> > +++ linux/mm/vmscan.c 2004-05-30 21:45:41.000000000 +0200
> > @@ -1098,10 +1098,13 @@
> > pg_data_t *pgdat;
> > int nr_to_free = nr_pages;
> > int ret = 0;
> > + int old_swappiness = vm_swappiness;
> > struct reclaim_state reclaim_state = {
> > .reclaimed_slab = 0,
> > };
> >
> > + vm_swappiness = 100;
> > +
> > current->reclaim_state = &reclaim_state;
> > for_each_pgdat(pgdat) {
> > int freed;
> > @@ -1115,6 +1118,8 @@
> > break;
> > }
> > current->reclaim_state = NULL;
> > +
> > + vm_swappiness = old_swappiness;
> > return ret;
> > }
> > #endif
>
> Good stuff. I've cc'ed Con Kolivas in on this as he's just recently posted his
> updated "Autoregulated VM swappiness" patch. In particular, this could also
> cause some issues if it made it into the main tree, as then this code might
> fail/cause issues (eg: as both could end up writing to vm_swappiness at the
> same time). This could possibly be a race condition as per Oliver's earlier
> observation (even if it's non-fatal, it's at least annoying).

During suspend, all processes are frozen and we are running on single
processor. I do not think we can race with anyone.
Pavel
--
934a471f20d6580d5aad759bf0d97ddc
-
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/