From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DA32C11D32 for ; Mon, 24 Feb 2020 13:19:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F60A20828 for ; Mon, 24 Feb 2020 13:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727474AbgBXNTl (ORCPT ); Mon, 24 Feb 2020 08:19:41 -0500 Received: from foss.arm.com ([217.140.110.172]:36978 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727281AbgBXNTk (ORCPT ); Mon, 24 Feb 2020 08:19:40 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3790730E; Mon, 24 Feb 2020 05:19:40 -0800 (PST) Received: from [10.163.1.29] (unknown [10.163.1.29]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD26E3F534; Mon, 24 Feb 2020 05:19:35 -0800 (PST) Subject: Re: [PATCH] mm/vma: Append unlikely() while testing VMA access permissions To: Geert Uytterhoeven Cc: Linux MM , Guo Ren , Ralf Baechle , Paul Burton , Mike Rapoport , Andrew Morton , linux-m68k , linux-mips@vger.kernel.org, linux-csky@vger.kernel.org, Linux Kernel Mailing List References: <1582525304-32113-1-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: Date: Mon, 24 Feb 2020 18:49:34 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/24/2020 03:39 PM, Geert Uytterhoeven wrote: > Hi Anshuman, > > Thanks for your patch! > > On Mon, Feb 24, 2020 at 7:22 AM Anshuman Khandual > wrote: >> It is unlikely that an inaccessible VMA without required permission flags >> will get a page fault. Hence lets just append unlikely() directive to such > > Why? Isn't it the idea that you get a page fault when the page is not > accessible? Yeah it is. But the point here is to have a directive indicating that it is unlikely that such scenarios will exist frequently even though they are very much possible. > >> checks in order to improve performance while also standardizing it across >> various platforms. > > Does it make a difference to add these? Have you benchmarked this? > https://lwn.net/Articles/420019/ I dont have access to these platforms. As I had noted down previously, this was only build tested. The primary motivation was that the likeliness or rather unlikeliness for page faults on inaccessible VMAs are more workload specific. Hence should not be platform dependent and this change was just trying to make it similar in some platforms. > > Gr{oetje,eeting}s, > > Geert > > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds >