From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751201AbcJZJHL (ORCPT ); Wed, 26 Oct 2016 05:07:11 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38128 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395AbcJZJHJ (ORCPT ); Wed, 26 Oct 2016 05:07:09 -0400 Date: Wed, 26 Oct 2016 11:07:05 +0200 From: Michal Hocko To: Lorenzo Stoakes Cc: linux-mm@kvack.org, Linus Torvalds , Jan Kara , Hugh Dickins , Dave Hansen , Rik van Riel , Mel Gorman , Andrew Morton , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Message-ID: <20161026090705.GA18382@dhcp22.suse.cz> References: <20161025233609.5601-1-lstoakes@gmail.com> <20161026075952.GA30977@lucifer> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161026075952.GA30977@lucifer> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 26-10-16 08:59:52, Lorenzo Stoakes wrote: > On Wed, Oct 26, 2016 at 12:36:09AM +0100, Lorenzo Stoakes wrote: > > In hva_to_pfn_slow() we are able to replace __get_user_pages_unlocked() with > > get_user_pages_unlocked() since we can now pass gup_flags. > > > > In async_pf_execute() we need to pass different tsk, mm arguments so > > get_user_pages_remote() is the sane replacement here (having added manual > > acquisition and release of mmap_sem.) > > > > Since we pass a NULL pages parameter the subsequent call to > > __get_user_pages_locked() will have previously bailed any attempt at > > VM_FAULT_RETRY, so we do not change this behaviour by using > > get_user_pages_remote() which does not invoke VM_FAULT_RETRY logic at all. > > > > Signed-off-by: Lorenzo Stoakes > > Note that the use of get_user_pages_remote() in async_pf_execute() reintroduces > the use of the FOLL_TOUCH flag - I don't think this is a problem as this flag > was dropped by 1e987790 ("mm/gup: Introduce get_user_pages_remote()") which > states 'Without protection keys, this patch should not change any behavior', so > I don't think this was intentional. Yes, I have already mentioned this in one of my previous emails. This indeed doesn't seem to be intentional -- Michal Hocko SUSE Labs