All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] swapping: replace mem_free by mem_available
Date: Mon, 1 Aug 2016 18:37:21 +0800	[thread overview]
Message-ID: <20160801103721.GC20856@gmail.com> (raw)
In-Reply-To: <799714053.10227172.1470045890634.JavaMail.zimbra@redhat.com>

On Mon, Aug 01, 2016 at 06:04:50AM -0400, Jan Stancek wrote:
> 
> ----- Original Message -----
> > +
> > +	/* at least 10MB available physical memory needed */
> > +	if (mem_available_init < 10240)
> >  			tst_brkm(TCONF, cleanup,
> > -				 "Not enough free memory to test.");
> > -	}
> > -	if (swap_free_init < mem_over)
> > -		tst_brkm(TCONF, cleanup, "Not enough swap space to test.");
> > +				 "Not enough avalable memory to test.");
> > +
> > +	if (swap_total < mem_over_max)
> > +		tst_brkm(TCONF, cleanup, "swap size is not fit to test");
> 
> Shouldn't this be "swap_free_init > mem_over_max"? Some of the swap
> can be used at the start of test and condition below compares the
> difference from initial value.

sure, that would be more precise.

> > -		}
> > +	i = 0;
> > +	while (i < 10) {
> > +		swap_free_now = read_meminfo("SwapFree:");
> >  		sleep(1);
> > +		if (abs(swap_free_now - read_meminfo("SwapFree:")) < 512)
> > +			break;
> > +
> > +		i++;
> >  	}
> > +
> 
> I'd probably add here:
>   swap_free_now = read_meminfo("SwapFree:");
> again, since current value can be stale.

Ok, agree your point. Thanks for reviewing.

Regards,
Li Wang

      reply	other threads:[~2016-08-01 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01  8:28 [LTP] [PATCH v2] swapping: replace mem_free by mem_available Li Wang
2016-08-01 10:04 ` Jan Stancek
2016-08-01 10:37   ` Li Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160801103721.GC20856@gmail.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.