From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Cyrill Gorcunov <gorcunov@gmail.com>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 2/5] proc: use down_read_killable for /proc/pid/smaps_rollup
Date: Sun, 9 Jun 2019 12:07:36 +0300 [thread overview]
Message-ID: <bda80d9c-7594-94c9-db2c-37b8bc3b58c8@yandex-team.ru> (raw)
In-Reply-To: <20190517124555.GB1825@dhcp22.suse.cz>
On 17.05.2019 15:45, Michal Hocko wrote:
> On Wed 15-05-19 11:41:14, Konstantin Khlebnikov wrote:
>> Ditto.
>
> Proper changelog or simply squash those patches into a single patch if
> you do not feel like copy&paste is fun
>
>>
>> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
>> ---
>> fs/proc/task_mmu.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
>> index 2bf210229daf..781879a91e3b 100644
>> --- a/fs/proc/task_mmu.c
>> +++ b/fs/proc/task_mmu.c
>> @@ -832,7 +832,10 @@ static int show_smaps_rollup(struct seq_file *m, void *v)
>>
>> memset(&mss, 0, sizeof(mss));
>>
>> - down_read(&mm->mmap_sem);
>> + ret = down_read_killable(&mm->mmap_sem);
>> + if (ret)
>> + goto out_put_mm;
>
> Why not ret = -EINTR. The seq_file code seems to be handling all errors
> AFAICS.
>
I've missed your comment. Sorry.
down_read_killable returns 0 for success and exactly -EINTR for failure.
>> +
>> hold_task_mempolicy(priv);
>>
>> for (vma = priv->mm->mmap; vma; vma = vma->vm_next) {
>> @@ -849,8 +852,9 @@ static int show_smaps_rollup(struct seq_file *m, void *v)
>>
>> release_task_mempolicy(priv);
>> up_read(&mm->mmap_sem);
>> - mmput(mm);
>>
>> +out_put_mm:
>> + mmput(mm);
>> out_put_task:
>> put_task_struct(priv->task);
>> priv->task = NULL;
>
next prev parent reply other threads:[~2019-06-09 9:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 8:41 [PATCH 1/5] proc: use down_read_killable for /proc/pid/maps Konstantin Khlebnikov
2019-05-15 8:41 ` [PATCH 2/5] proc: use down_read_killable for /proc/pid/smaps_rollup Konstantin Khlebnikov
2019-05-17 12:45 ` Michal Hocko
2019-06-09 9:07 ` Konstantin Khlebnikov [this message]
2019-06-10 18:58 ` Michal Hocko
2019-05-15 8:41 ` [PATCH 3/5] proc: use down_read_killable for /proc/pid/pagemap Konstantin Khlebnikov
2019-05-17 12:46 ` Michal Hocko
2019-05-15 8:41 ` [PATCH 4/5] proc: use down_read_killable for /proc/pid/clear_refs Konstantin Khlebnikov
2019-05-17 12:47 ` Michal Hocko
2019-05-15 8:41 ` [PATCH 5/5] proc: use down_read_killable for /proc/pid/map_files Konstantin Khlebnikov
2019-05-15 17:00 ` Roman Gushchin
2019-05-15 9:05 ` [PATCH 1/5] proc: use down_read_killable for /proc/pid/maps Cyrill Gorcunov
2019-05-15 9:16 ` Kirill Tkhai
2019-05-17 12:41 ` Michal Hocko
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=bda80d9c-7594-94c9-db2c-37b8bc3b58c8@yandex-team.ru \
--to=khlebnikov@yandex-team.ru \
--cc=akpm@linux-foundation.org \
--cc=gorcunov@gmail.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@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;
as well as URLs for NNTP newsgroup(s).