public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Joerg Vehlow <lkml@jv-coder.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] overcommit_memory: Fix unstable subtest
Date: Fri, 4 Dec 2020 06:35:56 +0100	[thread overview]
Message-ID: <f17f7936-5fd2-b217-e945-1409d9d40eeb@jv-coder.de> (raw)
In-Reply-To: <20201203153030.GE5809@yuki.lan>

Hi Cyril,
> This version looks better. However two (minor) comments for this
> function still apply.
I'll respond to the comments here:
> Why don't we put the first argument on the same line as the MAX( or MIN(
> here? That would be much more compact but still nicely readable.
Will change that
> I do wonder, are the counters flushed if task is migrated between CPUs?
> If so we wouldn't need the multiplication by bcpus.
IIRC, no they are not flushed and there wouldn't be any reason for that. 
These counters are not supposed to account per cpu statistics, they are 
just used to prevent lock contention. If a task is migrated to another 
cpu and it's memory is freed there, the counter may become negative, 
which is perfectly fine.
Additionally this total batch size is the maximum amount, the global 
counter can deviate from the real value. This takes into account all 
processes running on all cpus, because the overcommit limit is a global 
limit, not a per task one.
> Can we please call the get_total_back_size_bytes() in the test setup and
> store the value.
I think I left this in the test function, because there is a slight 
chance, that the value changes over time due to hotplug. If cpus are 
added (really plugged into the system, not only enabled) or if there is 
memory added, the value changes. In vms with memory ballooning, I think 
this is more likely to happen. The cost is not very high, so why add the 
possiblity to break this?

If you are ok with me only changing the formatting of the MIN/MAX stuff, 
I'll send a v4.

J?rg

  reply	other threads:[~2020-12-04  5:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27  7:14 [LTP] [PATCH v3] overcommit_memory: Fix unstable subtest Joerg Vehlow
2020-11-30  8:01 ` Richard Palethorpe
2020-11-30  8:30   ` Joerg Vehlow
2020-11-30  8:54     ` Richard Palethorpe
2020-12-03 15:30 ` Cyril Hrubis
2020-12-04  5:35   ` Joerg Vehlow [this message]
2020-12-11 14:29     ` 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=f17f7936-5fd2-b217-e945-1409d9d40eeb@jv-coder.de \
    --to=lkml@jv-coder.de \
    --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