From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:33885 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751266AbcCJP46 (ORCPT ); Thu, 10 Mar 2016 10:56:58 -0500 Date: Thu, 10 Mar 2016 16:56:55 +0100 From: Michal Hocko Subject: Re: [PATCH 01/18] mm: Make mmap_sem for write waits killable for mm syscalls Message-ID: <20160310155655.GB22452@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-2-git-send-email-mhocko@kernel.org> <56E19704.6030708@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E19704.6030708@suse.cz> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vlastimil Babka Cc: LKML , Andrew Morton , linux-mm@kvack.org, Alex Deucher , Alex Thorlton , Andrea Arcangeli , Andy Lutomirski , Benjamin LaHaise , Christian =?iso-8859-1?Q?K=F6nig?= , Daniel Vetter , Dave Hansen , David Airlie , Davidlohr Bueso , David Rientjes , "H . Peter Anvin" , Hugh Dickins , Ingo Molnar , Johannes Weiner , "Kirill A . Shutemov" , Konstantin Khlebnikov , linux-arch@vger.kernel.org, Mel Gorman , Oleg Nesterov , Peter Zijlstra , Petr Cermak , Thomas Gleixner Message-ID: <20160310155655.d6KLL8HIOxfc7Wyw1N1-lbSrgHhDnJ-F6hYt-HK6Jqg@z> On Thu 10-03-16 16:47:16, Vlastimil Babka wrote: > On 02/29/2016 02:26 PM, Michal Hocko wrote: > >From: Michal Hocko > > > >This is the first step in making mmap_sem write holders killable. It > > s/holders/waiters/? right. Fixed > >focuses on the trivial ones which are taking the lock early after > >entering the syscall and they are not changing state before. > > > >Therefore it is very easy to change them to use down_write_killable > >and immediately return with -EINTR. This will allow the waiter to > >pass away without blocking the mmap_sem which might be required to > >make a forward progress. E.g. the oom reaper will need the lock for > >reading to dismantle the OOM victim address space. > > > >The only tricky function in this patch is vm_mmap_pgoff which has many > >call sites via vm_mmap. To reduce the risk keep vm_mmap with the > >original non-killable semantic for now. > > > >vm_munmap callers do not bother checking the return value so open code > >it into the munmap syscall path for now for simplicity. > > > >Cc: Mel Gorman > >Cc: "Kirill A. Shutemov" > >Cc: Konstantin Khlebnikov > >Cc: Hugh Dickins > >Cc: Andrea Arcangeli > >Cc: David Rientjes > >Cc: Dave Hansen > >Cc: Johannes Weiner > >Signed-off-by: Michal Hocko > > Acked-by: Vlastimil Babka Thanks! -- Michal Hocko SUSE Labs