Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1489399ybl; Fri, 31 Jan 2020 23:28:17 -0800 (PST) X-Google-Smtp-Source: APXvYqytQlLpjmXWsGl2trA/1NsN1Yw1UZFNEHWlLTM1SXx5H/7akL6QU3XgYterYr+HmD+ibNbM X-Received: by 2002:a05:6830:155a:: with SMTP id l26mr10591114otp.339.1580542097171; Fri, 31 Jan 2020 23:28:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580542097; cv=none; d=google.com; s=arc-20160816; b=ZZdGRAjqMZ+BPbRKS00v2kiSGhvcVp+0+dGRjtmR3CZV8m9dDHEYe2FDftltR/3Dor es3KYMkzA5LnPB+djLNH+Nt9zOcpnNsuY0T273aNsIvTi4GxRWVb9DzEJfoOKp6udvJj UT8OHAViRQs7ZfNllcvTvfcRew6+fsNEJa+qRrykVkBYWE2A5dnM3XMLIPMb0N3QVP8f hRJZ60s4g4EZQtaXlH8HtsQhJFEEyI599Twvp2ygO1jVTZNktiS3R+FCx7ch9Gh1YeeF 3amCFpKffbHKYiBqhBwtUmjg5Wr+jR+qH4GZrSxI5UY2wNZ8XQ2cCoCaofPx+srS7WmW S9hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=9l9PsBwIB/NYkRjEMFn4Ks/uI+7ROcMFBYo9P9qvCmw=; b=PfhMDU9LkxVCH8MzJ2RWuLVIrqNpK9CFKUwl9gDpRCmBuooYf+IfdeUVq3B5dr2SHw yqCQTC7GbK52xWI/C56/X1+5cTDAobo0Uq9vS/5kvIOXFY6FIafZlYT85xwCeNDdIbgn uCzJCkDZ5UVx/Yfux7MlQQqxBgQ9aZm9co3erj7+8CslSjRBElH0YLPrdZGyjWWGbxyS wfJNR22kYUyDb7ljQKoH2ciSvituS1zYnekW920AbDv4diYQajpbzesRDUc8WAYkyokT goMZT6TYX6fla5Zx/zyv9sQpyMBK+Hk/7EzIc4yFvkCgAHaxDLigE8BXMbuxcQFBd5uB DgVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=EX2Udq8y; 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 h8si5172464oib.104.2020.01.31.23.28.04; Fri, 31 Jan 2020 23:28:17 -0800 (PST) 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=pass header.i=@c-s.fr header.s=mail header.b=EX2Udq8y; 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 S1726195AbgBAH1I (ORCPT + 99 others); Sat, 1 Feb 2020 02:27:08 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:1168 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgBAH1I (ORCPT ); Sat, 1 Feb 2020 02:27:08 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 488lyy42tcz9txXQ; Sat, 1 Feb 2020 08:27:06 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=EX2Udq8y; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 70CcpBS5VEwM; Sat, 1 Feb 2020 08:27:06 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 488lyy2ptBz9txXN; Sat, 1 Feb 2020 08:27:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1580542026; bh=9l9PsBwIB/NYkRjEMFn4Ks/uI+7ROcMFBYo9P9qvCmw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=EX2Udq8yH+9nfUQ150awGDI4kbu47uUcdR/iQ13e34KUPLEXEDPAr3L301v56h+uz J3AkG7HZNLNNQPtS6j8KLjNdcvWjGYUJGnEaIgnu4UVPT/tR4dh4O0mU/tgBLgnPmO n2+xG/HNbDeNxGI7q9PQtkBGsLKVmxoRlop+74Wo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4E75D8B785; Sat, 1 Feb 2020 08:27:07 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id UknSbPvdziV1; Sat, 1 Feb 2020 08:27:07 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C7FAB8B752; Sat, 1 Feb 2020 08:27:06 +0100 (CET) Subject: Re: [PATCH] powerpc/32s: Don't flush all TLBs when flushing one page To: Segher Boessenkool Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20200131155150.GD22482@gate.crashing.org> <27cef66b-df5b-0baa-abac-5532e58bd055@c-s.fr> <20200131193833.GF22482@gate.crashing.org> From: Christophe Leroy Message-ID: <248a3cf3-1b5e-a6e1-ceec-0e3904d1cf51@c-s.fr> Date: Sat, 1 Feb 2020 08:27:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200131193833.GF22482@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 31/01/2020 à 20:38, Segher Boessenkool a écrit : > On Fri, Jan 31, 2020 at 05:15:20PM +0100, Christophe Leroy wrote: >> Le 31/01/2020 à 16:51, Segher Boessenkool a écrit : >>> On Fri, Jan 31, 2020 at 03:37:34PM +0000, Christophe Leroy wrote: >>>> When the range is a single page, do a page flush instead. >>> >>>> + start &= PAGE_MASK; >>>> + end = (end - 1) | ~PAGE_MASK; >>>> if (!Hash) { >>>> - _tlbia(); >>>> + if (end - start == PAGE_SIZE) >>>> + _tlbie(start); >>>> + else >>>> + _tlbia(); >>>> return; >>>> } >>> >>> For just one page, you get end - start == 0 actually? >> >> Oops, good catch. >> >> Indeed you don't get PAGE_SIZE but (PAGE_SIZE - 1) for just one page. > > You have all low bits masked off in both start and end, so you get zero. > You could make the condion read "if (start == end)? No, in end the low bits are set, that's a BIT OR with ~PAGE_MASK, so it sets all low bits to 1. Christophe