From: David Hildenbrand <david@redhat.com>
To: CGEL <cgel.zte@gmail.com>
Cc: akpm@linux-foundation.org, bsingharora@gmail.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Yang Yang <yang.yang29@zte.com.cn>,
Ran Xiaokai <ran.xiaokai@zte.com.cn>
Subject: Re: [PATCH] delayacct: track delays from COW
Date: Fri, 8 Apr 2022 09:31:23 +0200 [thread overview]
Message-ID: <a6ce4cd3-dfbc-134c-88a0-40fefa8094f6@redhat.com> (raw)
In-Reply-To: <624d434a.1c69fb81.11e99.b2b8@mx.google.com>
On 06.04.22 09:37, CGEL wrote:
> On Wed, Mar 23, 2022 at 09:49:46AM +0100, David Hildenbrand wrote:
>> On 22.03.22 12:04, cgel.zte@gmail.com wrote:
>>> From: Yang Yang <yang.yang29@zte.com.cn>
>>>
>>> Delay accounting does not track the delay of COW. When tasks trigger
>>> much COW, it may spend a amount of time waiting for it. To get the
>>> impact of tasks in COW, measure the delay when it happens. This
>>> could help users to do tunnings, such as decide whether to use
>>> ksm or not.
>>>
>>> Also update tools/accounting/getdelays.c:
>>>
>>> / # ./getdelays -dl -p 231
>>> print delayacct stats ON
>>> listen forever
>>> PID 231
>>>
>>> CPU count real total virtual total delay total delay average
>>> 6247 1859000000 2154070021 1674255063 0.268ms
>>> IO count delay total delay average
>>> 0 0 0ms
>>> SWAP count delay total delay average
>>> 0 0 0ms
>>> RECLAIM count delay total delay average
>>> 0 0 0ms
>>> THRASHING count delay total delay average
>>> 0 0 0ms
>>> COMPACT count delay total delay average
>>> 3 72758 0ms
>>> COW count delay total delay average
>>> 3635 271567604 0ms
>>
>> You should also update Documentation/accounting/delay-accounting.rst
>> most probably.
>>
>> Overall LGTM and this might be of value not only for KSM but for anybody
>> using fork(). There will be collisions with [1], especially [2], which I
>> want to get in -next early after we have v5.18-rc1 (after rebasing [1]
>> on top of this).
>>
>> We'll have to decide if we want to also account hugetlb wp code
>> (hugetlb_cow), and if we want to account "unsharing" here as well under
>> cow (I tend to say that we want to for simplicity). For THP, we only
>> split and don't copy, so there isn't anything to account.
>>
> As for simplicity, what about account "PAGECOPY" instead of "COW"?
> "PAGECOPY" include COW and unsharing. And we may also account hugetlb
> wp in follow-up patches, based on this patch is sufficient reviewed.
PAGECOPY might be too generic. You actually want to express "potentially
shared page was copied by the write-fault handler while it was write
protected".
do_wp_page()->wp_page_copy()
Maybe simply "WP_COPY" as a prefix ("Write-protect copy") ?
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2022-04-08 7:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 11:04 [PATCH] delayacct: track delays from COW cgel.zte
2022-03-23 8:49 ` David Hildenbrand
2022-03-23 9:05 ` CGEL
2022-04-06 7:37 ` CGEL
2022-04-08 7:31 ` David Hildenbrand [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=a6ce4cd3-dfbc-134c-88a0-40fefa8094f6@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bsingharora@gmail.com \
--cc=cgel.zte@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ran.xiaokai@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
/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;
as well as URLs for NNTP newsgroup(s).