From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: do not show VmExe bigger than total executable virtual memory
Date: Wed, 11 Oct 2017 10:00:06 +0300 [thread overview]
Message-ID: <bfa040ba-7935-02b6-3736-4b71aac31619@yandex-team.ru> (raw)
In-Reply-To: <20171010152504.c0b84899a95e0bcd79b73290@linux-foundation.org>
On 11.10.2017 01:25, Andrew Morton wrote:
> On Fri, 06 Oct 2017 14:32:34 +0300 Konstantin Khlebnikov <khlebnikov@yandex-team.ru> wrote:
>
>> If start_code / end_code pointers are screwed then "VmExe" could be bigger
>> than total executable virtual memory and "VmLib" becomes negative:
>>
>> VmExe: 294320 kB
>> VmLib: 18446744073709327564 kB
>>
>> VmExe and VmLib documented as text segment and shared library code size.
>>
>> Now their sum will be always equal to mm->exec_vm which sums size of
>> executable and not writable and not stack areas.
>
> When does this happen? What causes start_code/end_code to get "screwed"?
I don't know exactly what happened.
I've seen this for huge (>2Gb) statically linked binary which has whole world inside.
For it start_code .. end_code range also covers one of rodata sections.
Probably this is bug in customized linker, elf loader or both.
Anyway CONFIG_CHECKPOINT_RESTORE allows to change these pointers,
thus we cannot trust them without validation.
>
> When these pointers are screwed, the result of end_code-start_code can
> still be wrong while not necessarily being negative, yes? In which
> case we'll still display incorrect output?
>
Here we split exec_vm into main code segment and libraries.
Range start_code .. end_code declared as main code segment.
In my case it's bigger than exec_vm, so libraries have to be negative.
After my patch libraries will be 0 and whole exec_vm show as VmExe.
At least sum VmExe + VmLib stays correct and both of them sane.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-10-11 7:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 11:32 Konstantin Khlebnikov
2017-10-10 22:25 ` Andrew Morton
2017-10-11 7:00 ` Konstantin Khlebnikov [this message]
2017-12-01 17:25 ` Vlastimil Babka
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=bfa040ba-7935-02b6-3736-4b71aac31619@yandex-team.ru \
--to=khlebnikov@yandex-team.ru \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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