Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp310899ybl; Wed, 21 Aug 2019 19:55:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+Tz1Wk3dUd1+fZ4f2+V8pdHGV6AobMn5GWiImTupk0xcfFuT6M6QK+/VVOKSWpbiI6ayt X-Received: by 2002:a63:714a:: with SMTP id b10mr32834476pgn.25.1566442544033; Wed, 21 Aug 2019 19:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566442544; cv=none; d=google.com; s=arc-20160816; b=sl5X99lkjpWFfx3YVM1voUpwcnW9eGkDj7Fv7ToaitGTdDo7YayvdHdt/ev4lXuPoj ixEAmwzRjiv4EtAFns2FOTUrdfmQduFBGK5SaDCv0AprH6dfUCXUmhhsHk8knuEOB3T1 hk+o6yd4C6ERz9+wy0BrJ3ii0h4ksXkCuFUBKTfmn+yPpAgHwg4/nhawSSz0/5iu+1GQ U6a0kqDWd5x1MnVv+8zEHDqFTtptOF2a9XSRNkEMyckCXC/BW0ydWG88SIVs7Ykge0jm 2KG+NQwdrOOg/KbG5IJfc9boewXWO16YLoY+lU4dqw+cLJmKCt3DZn4nXlxQQPBfPhBg J7UA== 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; bh=Jie17K/T15jRSBvKFlYHxVnPTP4EonPQuMMhIipo+TY=; b=ywrvitUwojnopoO/5KAH14G+dXTMH2tRNjgIw/GLReqBp0XyMRb2BE3tF9RZaONgd2 B5I1GEWmwszS6Nbh6YnfANrCyusVk6GG6BARIsXQGJ9aP4QLjdMc23XDogU7zAYvYWL2 3aMwOZOPlKSZPMQT4gfemM2W1PLWwHUg/EAz0t3+kpdP1FKOVwtCpVHR2DOyJqTYzOGk 6Vt/OHSr/1i2s29DPg+0yukQAQBv+1mtitxXhBZnXyqOkZ6PyzDmFlYCRmPhUgquMvLf rk21SDULAN47CZdvNU6GSchExjjMZy780N6JpXYyJqRfPxvFJ510V+9TXvm8nDhUPJIx h0WQ== ARC-Authentication-Results: i=1; mx.google.com; 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 q16si15429722pgv.140.2019.08.21.19.55.27; Wed, 21 Aug 2019 19:55:44 -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; 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 S1730703AbfHVBub (ORCPT + 99 others); Wed, 21 Aug 2019 21:50:31 -0400 Received: from verein.lst.de ([213.95.11.211]:42689 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730693AbfHVBub (ORCPT ); Wed, 21 Aug 2019 21:50:31 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E1AA168BFE; Thu, 22 Aug 2019 03:50:27 +0200 (CEST) Date: Thu, 22 Aug 2019 03:50:27 +0200 From: Christoph Hellwig To: Atish Patra Cc: linux-kernel@vger.kernel.org, Albert Ou , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Christoph Hellwig , Anup Patel , Andreas Schwab Subject: Re: [PATCH v3 2/3] RISC-V: Issue a tlb page flush if possible Message-ID: <20190822015027.GB11922@lst.de> References: <20190822004644.25829-1-atish.patra@wdc.com> <20190822004644.25829-3-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190822004644.25829-3-atish.patra@wdc.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 21, 2019 at 05:46:43PM -0700, Atish Patra wrote: > + if (size <= PAGE_SIZE && size != -1) > + local_flush_tlb_page(start); > + else > + local_flush_tlb_all(); As Andreas pointed out (unsigned long)-1 is actually larger than PAGE_SIZE, so we don't need the extra check.