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 2B33EC11D35 for ; Mon, 24 Feb 2020 13:19:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D5F1B20838 for ; Mon, 24 Feb 2020 13:19:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5F1B20838 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0BE1F6B0005; Mon, 24 Feb 2020 08:19:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06D276B0006; Mon, 24 Feb 2020 08:19:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E76F96B0007; Mon, 24 Feb 2020 08:19:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id CBCA06B0005 for ; Mon, 24 Feb 2020 08:19:43 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 958C9824556B for ; Mon, 24 Feb 2020 13:19:43 +0000 (UTC) X-FDA: 76525077846.09.pin49_37c147c53a13f X-HE-Tag: pin49_37c147c53a13f X-Filterd-Recvd-Size: 3208 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Mon, 24 Feb 2020 13:19:42 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 >