public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: liuxp11@chinatelecom.cn <liuxp11@chinatelecom.cn>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] syscalls/ioctl: ioctl_sg01.c: ioctl_sg01 invoked oom-killer
Date: Wed, 24 Mar 2021 17:26:59 +0800	[thread overview]
Message-ID: <202103241726592002447@chinatelecom.cn> (raw)
In-Reply-To: CAEemH2cW9djj3sN8j9Xj_A5iNB9DLhYYkK=nu8ypaOtiYMnLyw@mail.gmail.com

Hi Li Wang,
I think your patch is good.
1.CommitLimit is the memory that can be allocated by application.
2.ioctl_sg01 in serveral machines with your patch,the result is passed.

Thanks!
    
From: Li Wang
Date: 2021-03-05 17:02
To: liuxp11@chinatelecom.cn
CC: Cyril Hrubis; ltp; mdoucha
Subject: Re: Re: [LTP] [PATCH 1/2] syscalls/ioctl: ioctl_sg01.c: ioctl_sg01 invoked oom-killer
Hi Xinpeng,

On Fri, Mar 5, 2021 at 1:52 PM liuxp11@chinatelecom.cn <liuxp11@chinatelecom.cn> wrote:
--- a/lib/tst_memutils.c
+++ b/lib/tst_memutils.c
@@ -36,6 +36,13 @@ void tst_pollute_memory(size_t maxsize, int fillchar)
        if (info.freeram - safety < maxsize / info.mem_unit)
                maxsize = (info.freeram - safety) * info.mem_unit;

 ==>Thanks,but the maxsize original code need to be deleted,Right?

No, the maxsize code is also useful, it needs to define the value in
most common situations(i.e. CommitLimit > MemAvailable).

But I'm still hesitating to use ComitLimit as the threshold for 'maxsize'.
Because according to the Linux document, it says that only take effort
when overcommit_memory is setting to 2. But our test system all set 0
by default.

   "This limit is only adhered to if strict overcommit accounting is enabled
    (mode 2 in 'vm.overcommit_memory')."
    see: https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.rst

Seems to use CommitLimit looks a bit strict and strange to test.

And I even think the way to use MemAvailable is acceptable if
MemFree > MemAvailable, just like what you did in your last patch.

I'm still not very sure so far~
(But one thing I can confirm that MemAvailable < MemFree is correct behavior sometimes)

 

+       /*
+        * To respect CommitLimit to prevent test invoking OOM killer,
+        * this may appear on system with a smaller swap-disk (or disabled).
+        */
+       if (SAFE_READ_MEMINFO("CommitLimit:") < SAFE_READ_MEMINFO("MemAvailable:"))
+               maxsize = SAFE_READ_MEMINFO("CommitLimit:") * 1024 - (safety * info.mem_unit);
+
        blocksize = MIN(maxsize, blocksize);
        map_count = maxsize / blocksize;
        map_blocks = SAFE_MALLOC(map_count * sizeof(void *));
 

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210324/39164c88/attachment.htm>

  reply	other threads:[~2021-03-24  9:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 10:24 [LTP] [PATCH 1/2] syscalls/ioctl: ioctl_sg01.c: ioctl_sg01 invoked oom-killer Xinpeng Liu
2021-01-25 10:24 ` [LTP] [PATCH 2/2] syscalls/ioctl: ioctl_sg01.c:TBROK: Test killed! Xinpeng Liu
2021-01-27  4:41   ` Li Wang
2021-01-27  4:27 ` [LTP] [PATCH 1/2] syscalls/ioctl: ioctl_sg01.c: ioctl_sg01 invoked oom-killer Li Wang
2021-01-27  5:42   ` liuxp11
2021-01-27  6:54   ` liuxp11
2021-01-27  7:58     ` Li Wang
2021-01-27  8:05       ` Li Wang
2021-01-27  9:24         ` Cyril Hrubis
2021-01-27 10:03           ` Li Wang
2021-01-27  8:49       ` liuxp11
2021-01-27  9:50         ` Cyril Hrubis
2021-01-27  9:39 ` Cyril Hrubis
2021-01-27  9:53   ` Martin Doucha
2021-01-27 10:07     ` liuxp11
2021-01-27 10:04   ` liuxp11
2021-01-27 11:28     ` Martin Doucha
2021-01-27 11:41       ` liuxp11
2021-01-27 11:46         ` Martin Doucha
2021-01-27 11:50           ` liuxp11
2021-03-04  7:52     ` Li Wang
2021-03-05  5:52       ` liuxp11
2021-03-05  9:02         ` Li Wang
2021-03-24  9:26           ` liuxp11 [this message]
2021-04-11  5:01             ` Li Wang

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=202103241726592002447@chinatelecom.cn \
    --to=liuxp11@chinatelecom.cn \
    --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