From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754441AbaJCSX5 (ORCPT ); Fri, 3 Oct 2014 14:23:57 -0400 Received: from mail-vc0-f172.google.com ([209.85.220.172]:37726 "EHLO mail-vc0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753459AbaJCSXy (ORCPT ); Fri, 3 Oct 2014 14:23:54 -0400 MIME-Version: 1.0 In-Reply-To: <1412356087-16115-5-git-send-email-aarcange@redhat.com> References: <1412356087-16115-1-git-send-email-aarcange@redhat.com> <1412356087-16115-5-git-send-email-aarcange@redhat.com> Date: Fri, 3 Oct 2014 11:23:53 -0700 X-Google-Sender-Auth: O1gSAC5la5rwbUhaxpMs-CIrhB4 Message-ID: Subject: Re: [PATCH 04/17] mm: gup: make get_user_pages_fast and __get_user_pages_fast latency conscious From: Linus Torvalds To: Andrea Arcangeli Cc: qemu-devel@nongnu.org, KVM list , Linux Kernel Mailing List , linux-mm , Linux API , Andres Lagar-Cavilla , Dave Hansen , Paolo Bonzini , Rik van Riel , Mel Gorman , Andy Lutomirski , Andrew Morton , Sasha Levin , Hugh Dickins , Peter Feiner , "\\Dr. David Alan Gilbert\\" , Christopher Covington , Johannes Weiner , Android Kernel Team , Robert Love , Dmitry Adamushko , Neil Brown , Mike Hommey , Taras Glek , Jan Kara , KOSAKI Motohiro , Michel Lespinasse , Minchan Kim , Keith Packard , "Huangpeng (Peter)" , Isaku Yamahata , Anthony Liguori , Stefan Hajnoczi , Wenchao Xia , Andrew Jones , Juan Quintela Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 3, 2014 at 10:07 AM, Andrea Arcangeli wrote: > This teaches gup_fast and __gup_fast to re-enable irqs and > cond_resched() if possible every BATCH_PAGES. This is disgusting. Many (most?) __gup_fast() users just want a single page, and the stupid overhead of the multi-page version is already unnecessary. This just makes things much worse. Quite frankly, we should make a single-page version of __gup_fast(), and convert existign users to use that. After that, the few multi-page users could have this extra latency control stuff. And yes, the single-page version of get_user_pages_fast() is actually latency-critical. shared futexes hit it hard, and yes, I've seen this in profiles. Linus