public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] brk01: Rewrite from scratch.
Date: Thu, 21 Dec 2017 08:35:02 -0500 (EST)	[thread overview]
Message-ID: <1037328137.2233326.1513863302714.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20171219083814.13110-1-chrubis@suse.cz>




----- Original Message -----
> This commit rewrites the brk01 test from scratch since the original code
> wasn't making much sense.
> 
> Now we actually run the brk() in a loop increasing and shrinking the
> break repeatedly a few times, which the original code was supposed to do
> but never actually did since we do not pass the -i parameter in the
> runtest files.
> 
> The increment is also choosen to be much much more reasonable instead of
> using the multiple of the absolute address of the page break we choose
> much more modest 2 * pagesize - 1. Note that the increment is not page
> aligned since that way we also check that kernel page-aligns it just
> fine.
> 
> The sequence has been choosen to grow the heap first then shrink it to
> the original size, which should be safe since the heap never shrinks
> below its original size.
> 
> We also write to the newly allocated heap in a case that that the heap
> has grown, which should be safe enough in a case that we do not call
> anything that would cause memory to be allocated in the loop, since that
> way we will not rewrite anything that was previously stored there.
> 
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> 
> Changes since v1:
>  - dropped the tst_res(TINFO, ...) in the middle of the loop
>    and updated commit message
>  - used -B when git formatted the patch

Looks good to me.

Regards,
Jan

  reply	other threads:[~2017-12-21 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19  8:38 [LTP] [PATCH v2] brk01: Rewrite from scratch Cyril Hrubis
2017-12-21 13:35 ` Jan Stancek [this message]
2018-01-03 10:13   ` Cyril Hrubis

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=1037328137.2233326.1513863302714.JavaMail.zimbra@redhat.com \
    --to=jstancek@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox