Re: [PATCH] Re: simple FS application that hangs 2.4-test5, mem mgmtproblem or FS buffer cache mgmt problem?

From: Roger Larsson (roger.larsson@norran.net)
Date: Thu Aug 03 2000 - 08:36:35 EST


Hi again,

Correction!

Included a little too much...
Buggy code part of another experiment...

/RogerL

Roger Larsson wrote:
>
> Rik van Riel wrote:
> > [deleted]
> > Changing the limits will mean it's _harder_ to get into the
> > same situation, but it really doesn't do anything to actually
> > *fix* the problem. The problem being that kswapd doesn't get
> > run or doesn't free pages as fast as it should when we try to
> > wake it up.
> >
>
> Correct, but since we have less memory to play with...
> A failure of try_to_free_pages (not kswapd) with this scenario:
>
> - freeing some pages (FREE_COUNT - 1)
> - sleeping (due to need_reschedule or waiting for buffer)
> - other process uses up available pages
> - trying to free remaining (1) but failing
> - returning with success...
>
> the need_reschedule case can be improved with this:
> (always retrying the full amount after schedule sleep,
> probably a loop on failures in try_to_free_pages as well...)
>
> (in vmscan.c function do_try_to_free_pages)

> if (gfp_mask & __GFP_WAIT &&
This line was not intended as a part of the "patch"
(even if it should need some parenthesis...)
It should have looked like this.

                  if (current->need_resched) {
> schedule();
> /* time has passed - pressure too? */
> if (!memory_pressure())
> goto done;
> /* pages freed by me might be gone... */
> count = FREE_COUNT;
> }
>
> > (or kswapd going to sleep too soon? IMHO it should go to sleep
> > only when *all* zones have zone->free_pages > zone->pages_low
> > and at least one zone has zone->zone_wake_kswapd cleared)
> >
>
> Think so too - my original patch did this, in a complicated way...
> this should be an easier way. (also in vmscan.c (not tested))
>
> static inline int keep_kswapd_awake(void)
> {
> pg_data_t *pgdat;
>
> if (memory_pressure())
> return 1;
>
> pgdat = pgdat_list;
> do {
> int i;
> for(i = 0; i < MAX_NR_ZONES; i++) {
>
>
> I will prepare (and test) proper patches tomorrow...
>
> /RogerL
>
> --
> Home page:
> http://www.norran.net/nra02596/
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/

--
Home page:
  http://www.norran.net/nra02596/

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



This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:10 EST