From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbcB2SQ2 (ORCPT ); Mon, 29 Feb 2016 13:16:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54608 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbcB2SQ1 (ORCPT ); Mon, 29 Feb 2016 13:16:27 -0500 Date: Mon, 29 Feb 2016 19:16:24 +0100 From: Oleg Nesterov To: Michal Hocko Cc: LKML , Andrew Morton , linux-mm@kvack.org, Michal Hocko , Petr Cermak Subject: Re: [PATCH] mm, proc: make clear_refs killable Message-ID: <20160229181623.GH3615@redhat.com> References: <1456752417-9626-8-git-send-email-mhocko@kernel.org> <1456768587-24893-1-git-send-email-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456768587-24893-1-git-send-email-mhocko@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/29, Michal Hocko wrote: > > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -1027,11 +1027,15 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf, > }; > > if (type == CLEAR_REFS_MM_HIWATER_RSS) { > + if (down_write_killable(&mm->mmap_sem)) { > + count = -EINTR; > + goto out_mm; > + } > + We do not even need to change count, userspace won't see it anyway. But I agree it look more clean this way. I believe the patch is fine. Oleg.