xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v2 1/2] tools/xenstore: set oom score for xenstore daemon on Linux
Date: Fri, 9 Jul 2021 14:34:26 +0200	[thread overview]
Message-ID: <6c4b8bb2-56c0-e0ee-2eea-52f2925803c9@suse.com> (raw)
In-Reply-To: <467dc0c1-cf0a-2aaf-0c99-c1ca70b95912@xen.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2141 bytes --]

On 08.07.21 19:40, Julien Grall wrote:
> Hi Juergen,
> 
> On 08/06/2021 06:58, Juergen Gross wrote:
>> Xenstored is absolutely mandatory for a Xen host and it can't be
>> restarted, so being killed by OOM-killer in case of memory shortage is
>> to be avoided.
>>
>> Set /proc/$pid/oom_score_adj (if available) to -500 in order to allow
>> xenstored to use large amounts of memory without being killed.
>>
>> Make sure the pid file isn't a left-over from a previous run delete it
>> before starting xenstored.
> 
> This sentence is a bit confusing to read. Do you mean "*To* make 
> sure....*,* delete it before"?

Yes, will change it.

> 
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>> V2:
>> - set oom score from launch script (Julien Grall)
>> - split off open file descriptor limit setting (Julien Grall)
>> ---
>>   tools/hotplug/Linux/launch-xenstore.in | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/hotplug/Linux/launch-xenstore.in 
>> b/tools/hotplug/Linux/launch-xenstore.in
>> index 019f9d6f4d..3ad71e3d08 100644
>> --- a/tools/hotplug/Linux/launch-xenstore.in
>> +++ b/tools/hotplug/Linux/launch-xenstore.in
>> @@ -59,11 +59,14 @@ test -f @CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons 
>> && . @CONFIG_DIR@/@CONFIG_LEAF
>>           echo "No xenstored found"
>>           exit 1
>>       }
>> +    rm -f @XEN_RUN_DIR@/xenstored.pid
>>       echo -n Starting $XENSTORED...
>>       $XENSTORED --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
>>       systemd-notify --booted 2>/dev/null || timeout_xenstore 
>> $XENSTORED || exit 1
>> +    XS_PID=`cat @XEN_RUN_DIR@/xenstored.pid`
>> +    echo -500 >/proc/$XS_PID/oom_score_adj
> 
> NIT: It would be worth considering to introduce a variable so this can 
> be set from the configuration file.

Do you have any scenario in mind where this would be beneficial?

I'm not against it, but I'm wondering why anybody would want that
to be configurable.

> 
> With or without it:
> 
> Acked-by: Julien Grall <jgrall@amazon.com>

Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2021-07-09 12:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  5:58 [PATCH v2 0/2] tools/xenstore: set resource limits of xenstored Juergen Gross
2021-06-08  5:58 ` [PATCH v2 1/2] tools/xenstore: set oom score for xenstore daemon on Linux Juergen Gross
2021-07-08 17:40   ` Julien Grall
2021-07-09 12:34     ` Juergen Gross [this message]
2021-07-12  8:38       ` Julien Grall
2021-06-08  5:58 ` [PATCH v2 2/2] tools/xenstore: set open file descriptor limit for xenstored Juergen Gross
2021-06-08 16:39   ` Olaf Hering
2021-06-11  5:01     ` Juergen Gross
2021-06-11  5:46       ` Olaf Hering
2021-06-11  7:07         ` Juergen Gross
2021-06-11  7:28           ` Olaf Hering
2021-07-07  7:23 ` [PATCH v2 0/2] tools/xenstore: set resource limits of xenstored Juergen Gross

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=6c4b8bb2-56c0-e0ee-2eea-52f2925803c9@suse.com \
    --to=jgross@suse.com \
    --cc=iwj@xenproject.org \
    --cc=julien@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).