From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: John Stultz <john.stultz@linaro.org>
Cc: "Amit Pundir" <amit.pundir@linaro.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
lkml <linux-kernel@vger.kernel.org>,
"Android Kernel Team" <kernel-team@android.com>
Subject: Re: [RFC][PATCH] epoll: allow EPOLLWAKEUP flag if PM_SLEEP is enabled
Date: Wed, 13 Nov 2013 00:46:15 +0100 [thread overview]
Message-ID: <12494461.XagJySeqkW@vostro.rjw.lan> (raw)
In-Reply-To: <CALAqxLXL_rE=1BanFyR=4iTLsSoZttAu72aXraQnWBRr9HxYvw@mail.gmail.com>
On Tuesday, November 12, 2013 11:24:05 AM John Stultz wrote:
> On Mon, Nov 11, 2013 at 1:22 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Monday, November 11, 2013 11:26:31 PM Amit Pundir wrote:
> >> While looking into the problem, I found that ep_create_wakeup_source()
> >> reports ENOMEM if wakeup_source_register() returns NULL.
> >> ep_create_wakeup_source() assumes that NULL is only returned if we run
> >> into ENOMEM but NULL is also returned when CONFIG_PM_SLEEP is disabled.
> >
> > So the error value should not be ENOMEM.
>
> Right, ENOMEM is clearly wrong. I think its just not clear what the
> right thing to do is.
>
>
> >> If CONFIG_PM_SLEEP is disabled, stripping the EPOLLWAKEUP flag seems to
> >> be a reasonable solution here, allowing the call to succeed, while
> >> dropping the wakeup logic. While returning EINVAL might also be a good
> >> solution, stripping the flag seems to follow the established behavior,
> >> as is done when the process doesn't have sufficient capabilities to
> >> block suspend.
> >
> > Which is a different thing.
>
> Well, in the case of the process not having sufficient capabilities,
> -EPERM seems like a reasonable return value. But instead the wakeup
> flag is silently dropped. That's why Amit is asking if dropping the
> wakeup flag is also the right approach for the !PM_SLEEP case instead
> of returning EINVAL.
>
> Dropping the wakeup flag is the easier solution, since we don't have
> to then go through all the userspace code and have it handle the error
> and resubmit without the wakeup flag. I suspect this was the same
> consideration for the decision in the insufficient capabilities case,
> but I don't really know.
Yes, it was.
Thanks!
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
prev parent reply other threads:[~2013-11-12 23:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-11 17:56 Amit Pundir
2013-11-11 21:22 ` Rafael J. Wysocki
2013-11-12 19:24 ` John Stultz
2013-11-12 23:46 ` Rafael J. Wysocki [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=12494461.XagJySeqkW@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=amit.pundir@linaro.org \
--cc=arve@android.com \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®