From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:54002 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750907AbcCJPrW (ORCPT ); Thu, 10 Mar 2016 10:47:22 -0500 Subject: Re: [PATCH 01/18] mm: Make mmap_sem for write waits killable for mm syscalls References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-2-git-send-email-mhocko@kernel.org> From: Vlastimil Babka Message-ID: <56E19704.6030708@suse.cz> Date: Thu, 10 Mar 2016 16:47:16 +0100 MIME-Version: 1.0 In-Reply-To: <1456752417-9626-2-git-send-email-mhocko@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Michal Hocko , LKML Cc: Andrew Morton , linux-mm@kvack.org, Alex Deucher , Alex Thorlton , Andrea Arcangeli , Andy Lutomirski , Benjamin LaHaise , =?UTF-8?Q?Christian_K=c3=b6nig?= , 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 , Michal Hocko Message-ID: <20160310154716.ncakLOV8_dos61piux10vl8LYNt50O1HwEdcoa9ShF4@z> 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/? > 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