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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B915C43219 for ; Mon, 28 Feb 2022 13:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236782AbiB1NuF (ORCPT ); Mon, 28 Feb 2022 08:50:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236740AbiB1NuA (ORCPT ); Mon, 28 Feb 2022 08:50:00 -0500 Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BEC84A3E7; Mon, 28 Feb 2022 05:49:20 -0800 (PST) Received: by mail-vs1-f41.google.com with SMTP id u10so12962347vsu.13; Mon, 28 Feb 2022 05:49:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ZlhBssXvwBUH+DmkM+uVIB26RD/VtgYSa5UcFW0OSE=; b=ME1GTl9CGgA+A8M1UU52UG/Gtlss9C0iIg4sxO0WmL4Cd8Ic6L3kRYcInardep7fO7 qCrM852oJ1TUbDt5C5/9eOi4SuXkd/rwskANIZGpJDToD8R9dARY5tBW0fT61hKnyvS8 V6ernEVfyJKnqMblapwQU3+kAx85skIcTcyM40Clr6SHq6FWsr+/lVGspn1VThtwt2IM KNN0SXnrDy7atslQ8/Wufx+7gG6GzbfEVKhzJX9a5xneNo0k3odS+C7zKTflZMcmkY2d A7qASNElSJOigQl2zBS47az4uhgWQZqoeH6E/pnc9WStivpg3+AxFFsysiEgHqZu+8WT wIlQ== X-Gm-Message-State: AOAM5314yER7xvTQWX8RbYr0BQ7tT9BHwmA/PGgumRZYcGuzBDeBHZfj ASk+J2wwVgLMec50WYnFg0DlluAiuMbjyQ== X-Google-Smtp-Source: ABdhPJweMf/Et4YuLWxLus2oWw/go9t2rgdokcne6lJ/T6d4SmO528QF5G51ga8DIXgqHdlR6bqNMw== X-Received: by 2002:a67:d804:0:b0:31b:a7fd:2d9 with SMTP id e4-20020a67d804000000b0031ba7fd02d9mr7354987vsj.3.1646056159463; Mon, 28 Feb 2022 05:49:19 -0800 (PST) Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com. [209.85.217.44]) by smtp.gmail.com with ESMTPSA id q131-20020a1f2a89000000b003209a39cc60sm1668859vkq.5.2022.02.28.05.49.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 05:49:18 -0800 (PST) Received: by mail-vs1-f44.google.com with SMTP id j3so12992566vsi.7; Mon, 28 Feb 2022 05:49:18 -0800 (PST) X-Received: by 2002:a67:af08:0:b0:31b:9451:bc39 with SMTP id v8-20020a67af08000000b0031b9451bc39mr7516436vsl.68.1646056157983; Mon, 28 Feb 2022 05:49:17 -0800 (PST) MIME-Version: 1.0 References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 28 Feb 2022 14:49:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT To: "Russell King (Oracle)" Cc: Anshuman Khandual , Linux MM , Andrew Morton , Linux Kernel Mailing List , Christoph Hellwig , linuxppc-dev , Linux ARM , sparclinux , "open list:BROADCOM NVRAM DRIVER" , linux-m68k , linux-s390 , linux-riscv , alpha , Linux-sh list , arcml , linux-csky@vger.kernel.org, "open list:TENSILICA XTENSA PORT (xtensa)" , Parisc List , Openrisc , linux-um , "open list:QUALCOMM HEXAGON..." , "linux-ia64@vger.kernel.org" , Linux-Arch , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. 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 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 046A0C433F5 for ; Mon, 28 Feb 2022 13:49:48 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4K6hZf3fhHz3bqv for ; Tue, 1 Mar 2022 00:49:46 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.222.51; helo=mail-ua1-f51.google.com; envelope-from=geert.uytterhoeven@gmail.com; receiver=) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4K6hZB4LL5z30Gw for ; Tue, 1 Mar 2022 00:49:21 +1100 (AEDT) Received: by mail-ua1-f51.google.com with SMTP id a28so994212uaf.7 for ; Mon, 28 Feb 2022 05:49:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ZlhBssXvwBUH+DmkM+uVIB26RD/VtgYSa5UcFW0OSE=; b=bE3jEPXz4+N0w1HHhkQnsY61s18cDMXtj8HvPny+fuPxT4MrVMhDqTOW4bIYfHegSH C77YpJv0ulqCefqtoWnANSTv4vcpEfO5EPuRjq8LDnIpp6Z3boJ3oxMs8B7p3gh4kX6M r4OBzSJNR1vWbe8GpLO446W35VKnBW6A6511On6PmgXHf1T6aOpvK5Px6soqxlpaoBRQ zNJMjdUI6TzmyFll2p0Dwh4ZISb4PK4rL/x2vtwuYU9wTKHzM8n1sgPKdM9Ah9dSWvLT ipnW66l0byOU+eCg16jrDkjU+kZIGkftx3eMXKF8cb6fbJbtgs265goG6GmF2MBHwUI+ YNig== X-Gm-Message-State: AOAM532KUSIXKCnfNAGJAfTnX/b/lZ8Ir5tuWS4zuqy4pvVDUVXNJAxl PJH1+4yWB4Q9ukDk3qrSjph6ljmAec4JSg== X-Google-Smtp-Source: ABdhPJzivhjrFo4/bdLpUP/O4l6in4w4imxSio/rcdNcHEne8lpVAMnvzpdwqLfskv9qLaRinA1Htg== X-Received: by 2002:ab0:22c5:0:b0:342:da99:4190 with SMTP id z5-20020ab022c5000000b00342da994190mr7560415uam.24.1646056158671; Mon, 28 Feb 2022 05:49:18 -0800 (PST) Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com. [209.85.217.52]) by smtp.gmail.com with ESMTPSA id u190-20020a1fabc7000000b003334be45eeesm558442vke.34.2022.02.28.05.49.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 05:49:18 -0800 (PST) Received: by mail-vs1-f52.google.com with SMTP id y26so12980743vsq.8 for ; Mon, 28 Feb 2022 05:49:18 -0800 (PST) X-Received: by 2002:a67:af08:0:b0:31b:9451:bc39 with SMTP id v8-20020a67af08000000b0031b9451bc39mr7516436vsl.68.1646056157983; Mon, 28 Feb 2022 05:49:17 -0800 (PST) MIME-Version: 1.0 References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 28 Feb 2022 14:49:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT To: "Russell King (Oracle)" Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-ia64@vger.kernel.org" , Linux-sh list , "open list:BROADCOM NVRAM DRIVER" , Linux MM , sparclinux , linux-riscv , Linux-Arch , linux-s390 , "open list:QUALCOMM HEXAGON..." , linux-csky@vger.kernel.org, Christoph Hellwig , arcml , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Arnd Bergmann , Anshuman Khandual , linux-um , linux-m68k , Openrisc , Linux ARM , Parisc List , Linux Kernel Mailing List , alpha , Andrew Morton , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. 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 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAC65C433EF for ; Mon, 28 Feb 2022 13:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pJpD5oVTUtDQEQ9+X/8YWLre9Uc4+5tywNTQfjDq78o=; b=MxkGjoVarp0Fct pdfHENmol6/kU5olsdMztXZ5ZPYHIpWVfC4D481+UYnEF9rON0pdVzztJeP+k//QdbspSrsMCEqZ0 8rIdWHK1Jg4s73kvP+y1gmYUZccmVKTAV5b5WW46sjlWwl2TOy1yz0dWDcpYH2RVYh0nAOuO0H5q4 XX2hxpNdV+4vmLUnp6kGBDr02MV/4wiqoF1SPewdn4zSgIcYDdXaTWBolDvia66nQ4DDWtJ1sgMHV yL0XsIyPxMXfZ4O64WZVl4GUV5zE4RY9D6gllwQ04lQ+N3Sl43/tBYkxxsz8cA7aJNCoXzJf1r1an EUqUlor34sQB7PTEM8dA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOgTx-00Chnc-SI; Mon, 28 Feb 2022 13:54:33 +0000 Received: from mail-vk1-f179.google.com ([209.85.221.179]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOgOw-00Cg8Z-0D; Mon, 28 Feb 2022 13:49:24 +0000 Received: by mail-vk1-f179.google.com with SMTP id m195so2609855vka.5; Mon, 28 Feb 2022 05:49:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ZlhBssXvwBUH+DmkM+uVIB26RD/VtgYSa5UcFW0OSE=; b=w2KeJyPlbToh2mVN+TQoHpbKHZ4DDmVM/XsZJmUyRIzmXXVXH78QpYWquy8boISXxi aNrJOXpn0Up1mAK2e6MVqJxv/F2795ZCzLtbDO3lmFDMkEgZDuGyQrF3KZ+s8bSzVjIV 8Mam7IVHEdifLHIGL9bjc7CDOpak8R1Su7K3Sz1vxrf2O4ajF47Bsf9V8YSOZcdr4Noq F0VTNxrso7q4EGQdDHcpNrtqBp+sk5bhYirtNge8Z4JfwGYx5Oc/IRcX8lzDG6quKVB1 EMlSwh0SuFq4YzJCTnzwcat2G9mGmKk8YO7tBCqwIquZ9q/dMJM5/44rQ+0XB/2TeHlD NNxQ== X-Gm-Message-State: AOAM530yMPHbEpwAV3CQSyaKJd8DJ9oYagz0TL1Yeag/9lAiYu6bUOzv +zNgeqWkGiNuvJfWOOXJl14jFMWW4RVpGg== X-Google-Smtp-Source: ABdhPJyP1HtKZ+sPxWSe6XiIiB0etnOr0tkdoDAqBSVKViq0DnvbIN2QWe7VO8l5wdegrAVcoU1jiQ== X-Received: by 2002:a05:6122:1079:b0:32c:a52c:88a5 with SMTP id k25-20020a056122107900b0032ca52c88a5mr8083980vko.19.1646056159646; Mon, 28 Feb 2022 05:49:19 -0800 (PST) Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com. [209.85.217.46]) by smtp.gmail.com with ESMTPSA id s18-20020a05612204d200b00332f05df61bsm1363559vkn.49.2022.02.28.05.49.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 05:49:18 -0800 (PST) Received: by mail-vs1-f46.google.com with SMTP id w4so13029669vsq.1; Mon, 28 Feb 2022 05:49:18 -0800 (PST) X-Received: by 2002:a67:af08:0:b0:31b:9451:bc39 with SMTP id v8-20020a67af08000000b0031b9451bc39mr7516436vsl.68.1646056157983; Mon, 28 Feb 2022 05:49:17 -0800 (PST) MIME-Version: 1.0 References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 28 Feb 2022 14:49:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT To: "Russell King (Oracle)" Cc: Anshuman Khandual , Linux MM , Andrew Morton , Linux Kernel Mailing List , Christoph Hellwig , linuxppc-dev , Linux ARM , sparclinux , "open list:BROADCOM NVRAM DRIVER" , linux-m68k , linux-s390 , linux-riscv , alpha , Linux-sh list , arcml , linux-csky@vger.kernel.org, "open list:TENSILICA XTENSA PORT (xtensa)" , Parisc List , Openrisc , linux-um , "open list:QUALCOMM HEXAGON..." , "linux-ia64@vger.kernel.org" , Linux-Arch , Arnd Bergmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_054922_113284_2EE1FF65 X-CRM114-Status: GOOD ( 25.68 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. 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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66913C433F5 for ; Mon, 28 Feb 2022 13:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wZ1AqY1wAd8AHAJGe3Pr+G2t9M0DYQk2WYDVEKv/4Lg=; b=lDP+rM3Y6IHtqO bo3aUoGwPCZWBE+twLooSoCN8hTskImEZnRCb85YuYaB8HRbHcmkVZqHKBAg120shlcL3HucotJsg PP6i4U0aHxt9JF77Ijlv0eOV9XFXPj6PXc0a2SKjbbFjsCCYXmx6vQrBJH7PJZK5ZI0Kw1T4PE4ac tPtoENM1sKTXav/FIwJnH+h2u55qhYojANKszSZUdUUIDbJlCEsXXUEKWGKxsysebLuADGWhwqnza q4+27mUthdEORllD37qoxgG18CmaCooe+pd5/FoI8lNXr8oxpQRatO4AJtJVhgyDv2Z2324ZkC9fM JK3yRrN3xJYoR8DlBR/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOgU7-00Chqz-B0; Mon, 28 Feb 2022 13:54:43 +0000 Received: from mail-vk1-f179.google.com ([209.85.221.179]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOgOw-00Cg8Z-0D; Mon, 28 Feb 2022 13:49:24 +0000 Received: by mail-vk1-f179.google.com with SMTP id m195so2609855vka.5; Mon, 28 Feb 2022 05:49:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ZlhBssXvwBUH+DmkM+uVIB26RD/VtgYSa5UcFW0OSE=; b=w2KeJyPlbToh2mVN+TQoHpbKHZ4DDmVM/XsZJmUyRIzmXXVXH78QpYWquy8boISXxi aNrJOXpn0Up1mAK2e6MVqJxv/F2795ZCzLtbDO3lmFDMkEgZDuGyQrF3KZ+s8bSzVjIV 8Mam7IVHEdifLHIGL9bjc7CDOpak8R1Su7K3Sz1vxrf2O4ajF47Bsf9V8YSOZcdr4Noq F0VTNxrso7q4EGQdDHcpNrtqBp+sk5bhYirtNge8Z4JfwGYx5Oc/IRcX8lzDG6quKVB1 EMlSwh0SuFq4YzJCTnzwcat2G9mGmKk8YO7tBCqwIquZ9q/dMJM5/44rQ+0XB/2TeHlD NNxQ== X-Gm-Message-State: AOAM530yMPHbEpwAV3CQSyaKJd8DJ9oYagz0TL1Yeag/9lAiYu6bUOzv +zNgeqWkGiNuvJfWOOXJl14jFMWW4RVpGg== X-Google-Smtp-Source: ABdhPJyP1HtKZ+sPxWSe6XiIiB0etnOr0tkdoDAqBSVKViq0DnvbIN2QWe7VO8l5wdegrAVcoU1jiQ== X-Received: by 2002:a05:6122:1079:b0:32c:a52c:88a5 with SMTP id k25-20020a056122107900b0032ca52c88a5mr8083980vko.19.1646056159646; Mon, 28 Feb 2022 05:49:19 -0800 (PST) Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com. [209.85.217.46]) by smtp.gmail.com with ESMTPSA id s18-20020a05612204d200b00332f05df61bsm1363559vkn.49.2022.02.28.05.49.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 05:49:18 -0800 (PST) Received: by mail-vs1-f46.google.com with SMTP id w4so13029669vsq.1; Mon, 28 Feb 2022 05:49:18 -0800 (PST) X-Received: by 2002:a67:af08:0:b0:31b:9451:bc39 with SMTP id v8-20020a67af08000000b0031b9451bc39mr7516436vsl.68.1646056157983; Mon, 28 Feb 2022 05:49:17 -0800 (PST) MIME-Version: 1.0 References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 28 Feb 2022 14:49:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT To: "Russell King (Oracle)" Cc: Anshuman Khandual , Linux MM , Andrew Morton , Linux Kernel Mailing List , Christoph Hellwig , linuxppc-dev , Linux ARM , sparclinux , "open list:BROADCOM NVRAM DRIVER" , linux-m68k , linux-s390 , linux-riscv , alpha , Linux-sh list , arcml , linux-csky@vger.kernel.org, "open list:TENSILICA XTENSA PORT (xtensa)" , Parisc List , Openrisc , linux-um , "open list:QUALCOMM HEXAGON..." , "linux-ia64@vger.kernel.org" , Linux-Arch , Arnd Bergmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_054922_113284_2EE1FF65 X-CRM114-Status: GOOD ( 25.68 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. 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 _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6D00C433F5 for ; Mon, 28 Feb 2022 13:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3tSTm2a+Il0vSwYJyr+l312lUlYwqzE5/RbGCQBGIEU=; b=vVazJuxMf+cJiJ VOBGvLoRuhT8lOZTGAmUiZCRYoSD3A4nrFhDRfQIUN3n+pSsnY/0YctTZjEQ1fr4hXwk6+6Flj1S4 1srW8lhlooOiK7ix6sdPKJbhQDFyCdo0Dwwn13EtwkZZhtCLSl7s0cc8i1W0memNAXbEJP7GGrkY5 IiGuDPimaKjM5WfV8MQ2TYoW6ISje60DUrZ5joJamd1MNbhxcxY/O4PoVB7ZY4KfcgC9yaCX9hzMq 4IAV5RQP+6YL88ikEjoFHcqcM2nXSVYEYvCfEIW68mpPHheWt6wSmJq4+dzDPCwnSByaHarTZOAx1 N7XnEYxKPyfuDM4T6H9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOgSh-00ChKi-6O; Mon, 28 Feb 2022 13:53:16 +0000 Received: from mail-vk1-f179.google.com ([209.85.221.179]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOgOw-00Cg8Z-0D; Mon, 28 Feb 2022 13:49:24 +0000 Received: by mail-vk1-f179.google.com with SMTP id m195so2609855vka.5; Mon, 28 Feb 2022 05:49:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ZlhBssXvwBUH+DmkM+uVIB26RD/VtgYSa5UcFW0OSE=; b=w2KeJyPlbToh2mVN+TQoHpbKHZ4DDmVM/XsZJmUyRIzmXXVXH78QpYWquy8boISXxi aNrJOXpn0Up1mAK2e6MVqJxv/F2795ZCzLtbDO3lmFDMkEgZDuGyQrF3KZ+s8bSzVjIV 8Mam7IVHEdifLHIGL9bjc7CDOpak8R1Su7K3Sz1vxrf2O4ajF47Bsf9V8YSOZcdr4Noq F0VTNxrso7q4EGQdDHcpNrtqBp+sk5bhYirtNge8Z4JfwGYx5Oc/IRcX8lzDG6quKVB1 EMlSwh0SuFq4YzJCTnzwcat2G9mGmKk8YO7tBCqwIquZ9q/dMJM5/44rQ+0XB/2TeHlD NNxQ== X-Gm-Message-State: AOAM530yMPHbEpwAV3CQSyaKJd8DJ9oYagz0TL1Yeag/9lAiYu6bUOzv +zNgeqWkGiNuvJfWOOXJl14jFMWW4RVpGg== X-Google-Smtp-Source: ABdhPJyP1HtKZ+sPxWSe6XiIiB0etnOr0tkdoDAqBSVKViq0DnvbIN2QWe7VO8l5wdegrAVcoU1jiQ== X-Received: by 2002:a05:6122:1079:b0:32c:a52c:88a5 with SMTP id k25-20020a056122107900b0032ca52c88a5mr8083980vko.19.1646056159646; Mon, 28 Feb 2022 05:49:19 -0800 (PST) Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com. [209.85.217.46]) by smtp.gmail.com with ESMTPSA id s18-20020a05612204d200b00332f05df61bsm1363559vkn.49.2022.02.28.05.49.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 05:49:18 -0800 (PST) Received: by mail-vs1-f46.google.com with SMTP id w4so13029669vsq.1; Mon, 28 Feb 2022 05:49:18 -0800 (PST) X-Received: by 2002:a67:af08:0:b0:31b:9451:bc39 with SMTP id v8-20020a67af08000000b0031b9451bc39mr7516436vsl.68.1646056157983; Mon, 28 Feb 2022 05:49:17 -0800 (PST) MIME-Version: 1.0 References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 28 Feb 2022 14:49:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT To: "Russell King (Oracle)" Cc: Anshuman Khandual , Linux MM , Andrew Morton , Linux Kernel Mailing List , Christoph Hellwig , linuxppc-dev , Linux ARM , sparclinux , "open list:BROADCOM NVRAM DRIVER" , linux-m68k , linux-s390 , linux-riscv , alpha , Linux-sh list , arcml , linux-csky@vger.kernel.org, "open list:TENSILICA XTENSA PORT (xtensa)" , Parisc List , Openrisc , linux-um , "open list:QUALCOMM HEXAGON..." , "linux-ia64@vger.kernel.org" , Linux-Arch , Arnd Bergmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_054922_113284_2EE1FF65 X-CRM114-Status: GOOD ( 25.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Date: Mon, 28 Feb 2022 14:49:06 +0100 Subject: [OpenRISC] [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT In-Reply-To: References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Date: Mon, 28 Feb 2022 13:49:06 +0000 Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT Message-Id: List-Id: References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Russell King (Oracle)" Cc: Anshuman Khandual , Linux MM , Andrew Morton , Linux Kernel Mailing List , Christoph Hellwig , linuxppc-dev , Linux ARM , sparclinux , "open list:BROADCOM NVRAM DRIVER" , linux-m68k , linux-s390 , linux-riscv , alpha , Linux-sh list , arcml , linux-csky@vger.kernel.org, "open list:TENSILICA XTENSA PORT (xtensa)" , Parisc List , Openrisc , linux-um , "open list:QUALCOMM HEXAGON..." , "linux-ia64@vger.kernel.org" , Linux-Arch , Arnd Bergmann Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT Date: Mon, 28 Feb 2022 14:49:06 +0100 Message-ID: References: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> Mime-Version: 1.0 Return-path: In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Russell King (Oracle)" Cc: Anshuman Khandual , Linux MM , Andrew Morton , Linux Kernel Mailing List , Christoph Hellwig , linuxppc-dev , Linux ARM , sparclinux , "open list:BROADCOM NVRAM DRIVER" , linux-m68k , linux-s390 , linux-riscv , alpha , Linux-sh list , arcml , linux-csky@vger.kernel.org, "open list:TENSILICA XTENSA PORT (xtensa)" Hi Russell, On Mon, Feb 28, 2022 at 11:57 AM Russell King (Oracle) wrote: > On Mon, Feb 28, 2022 at 04:17:32PM +0530, Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > > macros can be dropped which are no longer needed. > > What I would really like to know is why having to run _code_ to work out > what the page protections need to be is better than looking it up in a > table. > > Not only is this more expensive in terms of CPU cycles, it also brings > additional code size with it. > > I'm struggling to see what the benefit is. I was wondering about that as well. But at least for code size on m68k, this didn't have much impact. Looking at the generated code, the increase due to using code for the (few different) cases is offset by a 16-bit jump table (which is to be credited to the compiler). In terms of CPU cycles, it's indeed worse than before. Gr{oetje,eeting}s, Geert