From: Michal Hocko <mhocko@suse.cz>
To: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
linux-mm@kvack.org
Subject: Re: [PATCH 2/2] Drivers: hv: balloon: Fix the deadlock issue in the memory hot-add code
Date: Tue, 9 Dec 2014 11:55:32 +0100 [thread overview]
Message-ID: <20141209105532.GB11373@dhcp22.suse.cz> (raw)
In-Reply-To: <5486CE2E.4070409@jp.fujitsu.com>
On Tue 09-12-14 19:25:50, Yasuaki Ishimatsu wrote:
> (2014/12/09 18:08), Michal Hocko wrote:
[...]
> >Doesn't udev retry the operation if it gets EBUSY or EAGAIN?
>
> It depend on implementation of udev.rules. So we can retry online/offline
> operation in udev.rules.
[...]
# Memory hotadd request
SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory*[0-9]", TEST=="/sys$devpath/state", RUN+="/bin/sh -c 'echo online > /sys$devpath/state'"
OK so this is not prepared for a temporary failures and retries.
> >And again, why cannot we simply make the onlining fail or try_lock and
> >retry internally if the event consumer cannot cope with errors?
>
> Did you mean the following Srinivasan's first patch looks good to you?
> https://lkml.org/lkml/2014/12/2/662
Heh, I was just about to post this. Because I haven't noticed the
previous patch yet. Yeah, Something like that. Except that I would
expect EAGAIN or EBUSY rather than ERESTARTSYS which should never leak
into userspace. And that would happen here AFAICS because signal_pending
will not be true usually.
So there are two options. Either make the udev rule more robust and
retry within RUN section or do the retry withing online_pages (try_lock
and go into interruptible sleep which gets signaled by finished
add_memory()). The later option is safer wrt. the userspace because the
operation wouldn't fail unexpectedly.
Another option would be generating the sysfs file after all the internal
initialization is done and call it outside of the memory hotplug lock.
--
Michal Hocko
SUSE Labs
--
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:[~2014-12-09 10:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-06 0:41 [PATCH 0/2] Drivers: hv: hv_balloon: Fix a deadlock in the hot-add path K. Y. Srinivasan
2014-12-06 0:41 ` [PATCH 1/2] Drivers: base: core: Export functions to lock/unlock device hotplug lock K. Y. Srinivasan
2014-12-06 0:41 ` [PATCH 2/2] Drivers: hv: balloon: Fix the deadlock issue in the memory hot-add code K. Y. Srinivasan
2014-12-08 15:04 ` Michal Hocko
2014-12-09 1:23 ` Yasuaki Ishimatsu
2014-12-09 9:08 ` Michal Hocko
2014-12-09 10:25 ` Yasuaki Ishimatsu
2014-12-09 10:55 ` Michal Hocko [this message]
2014-12-11 0:21 ` KY Srinivasan
2014-12-11 12:58 ` Michal Hocko
2014-12-14 18:45 ` KY Srinivasan
2014-12-08 0:07 ` [PATCH 0/2] Drivers: hv: hv_balloon: Fix a deadlock in the hot-add path Yasuaki Ishimatsu
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=20141209105532.GB11373@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=apw@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=olaf@aepfle.de \
/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