Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3684998ybl; Tue, 20 Aug 2019 00:18:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLZFKqfMzsaM8/KiX2ElS3JfgxzqgkEH5rTt8Qt04aPzbAhTFB9J/tcbXZjR/3mB0lYGIn X-Received: by 2002:aa7:938d:: with SMTP id t13mr27462827pfe.180.1566285493372; Tue, 20 Aug 2019 00:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566285493; cv=none; d=google.com; s=arc-20160816; b=nWDi8fsKalztuh5otH4KtibOeRhXzeP5YmW3VQKcIjdIYUnsLCe07yayHhIPUIMhNN LiTA6ZkzT6iKn5n89HHSFJLHTsbbvJ6Qq7UakVp0CfTngB9RUYDMWAz4EVXVRNPCF3dU M0vRxX0NKQvHpoo67u6zQmus68j0AlpqXor5dBqVOHmGz2hmXSHmicBLLXFqFW5ELg31 U0aCaNuh/FG2BBgSflQTl5r53K7r/ASVyaA3AOXRBq2D7g0GXNQSbb9XnW0Pkct4aH20 Yw8Yhiaf/VaXxM1L5iNsUoP5qEMHIAfjmMDdfaizwx0hWFkWmglU4WhSna+lzF5dxJXq 8dJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lfMEhlQnu3AQbdRShHq2/FNqFbFEMRrZzmwcGpLa/r4=; b=fOLQkhtFuW+txd+YUZEGyfoqOq+2kH9ted+kfVzB1RPVRtyYbDRAuLNPM/I6ahmq3h S82U4WpsBIz5prXFwqbnNvm+icI8yD/Yyew5OYjuF0LEQmO9P+ce7qd0F0Dbc6HsulCT USe6T1CNCytl/WLUeyZE7Jo0h8fjYvP4S7vvNGTZ6csTIscBEnRc0D6HGBQaF3E8nQEq E9JAryTH0WcdvrVEEiBemxL4aImRv9ZPsg1q/ViJGOPvlN5hXTUjQJcYB47W2VlRgtxE Aer3V7G0ClEI43AD1Eme/+4wdRi4vgbnIs++blC2oUpihzW1S7mqd7pl6wxb26ciqFtK W69Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aEGSTjWr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si11242055pgw.313.2019.08.20.00.17.58; Tue, 20 Aug 2019 00:18:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aEGSTjWr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729379AbfHTHQq (ORCPT + 99 others); Tue, 20 Aug 2019 03:16:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40896 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbfHTHQq (ORCPT ); Tue, 20 Aug 2019 03:16:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lfMEhlQnu3AQbdRShHq2/FNqFbFEMRrZzmwcGpLa/r4=; b=aEGSTjWrfC5T/gPgkoAl9emOB jpR+HeuhgJH5VChZ6hXzSQtJkEFN+1ao5y4ktMm9DS8YKAZ2YjtnEKItKtV49xMVHett7ovLWtPTr kB9+2vvZg503raqKPj27hndDRykBoMWHJG8lgsFJ+a30xYCNR9bnrQSZ2R3wokUQr55h3Vnbfap3B rnyZhdXCUvbahPv6G1h3zx8kaCvytvl3w/6WAwLnZAh7ChStMOGwolI7387+jymlKZUDp//jCLSX2 bD99UGJHpnQbeOCSc0plbm0KpEuODC44FWN6sshtoy8byV9bw3MuVBgHVQTfWdPNSvX8tna0f81au t68Z5MgwA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hzyNk-0002fi-2h; Tue, 20 Aug 2019 07:16:40 +0000 Date: Tue, 20 Aug 2019 00:16:40 -0700 From: "hch@infradead.org" To: Andreas Schwab Cc: "hch@infradead.org" , Atish Patra , Albert Ou , Anup Patel , Palmer Dabbelt , linux-kernel@vger.kernel.org, Paul Walmsley , linux-riscv@lists.infradead.org, Allison Randal Subject: Re: [v2 PATCH] RISC-V: Optimize tlb flush path. Message-ID: <20190820071639.GA2335@infradead.org> References: <20190820004735.18518-1-atish.patra@wdc.com> <20190820030641.GA24946@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 09:14:58AM +0200, Andreas Schwab wrote: > On Aug 19 2019, "hch@infradead.org" wrote: > > > This looks a little odd to m and assumes we never pass a size smaller > > than PAGE_SIZE. Whule that is probably true, why not something like: > > > > if (size < PAGE_SIZE && size != -1) > > ITYM size <= PAGE_SIZE. And since size is unsigned it cannot be == -1 > at the same time. Yes, the <= was obvious, that's what you get for hacking up a demo patch on the plan. And true for the -1. That being said I find the -1 convention rather annoying, a ULONG_MAX in the callers would be a lot more obvious.