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 A0E3AC7EE24 for ; Tue, 16 May 2023 08:10:47 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1yrJxMCslmCS4k7UTrPYyzT+7/wn/0roV7Cp09H504w=; b=RwYZ2WqSXKwTTq l3JxslwJGPWvGJMYh3Z6Xlzit/Y4p2J2VXoX9HqysYnGSpKTwqMotVP0cqt/73+BlXICcvEjUtWol fmoHqZBBekxACyAe2plMTMAMB55RpEZvXkKW8a3uPylWiXlerq8iuKimW+TUjeYRkWT2lm5Q2DcID PpzQ9hj3fELlB0ttzSx+VagBQG5/Ujnn97u/GUZ9A8nqty13PfM8jzQFskWtDj05qxhYM6/fst/9l etFoaepduNciQEdDZE42YT2jn/fAEJMDwtzmanpaYnmg6MbBrO1csrEGLHWPOs2onRcdRsjTGgRM/ J72+oh/1WBM+FZxnwztA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyplH-004nE4-0Z; Tue, 16 May 2023 08:10:23 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyplF-004nCu-0Q for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 08:10:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684224620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G87k5bjYh4/pByr4mnix3XiINdDbJc0blnbNeHR5grk=; b=KfXyT37/N0MNg9hmyY5fQG9gAlw8JH2jCqbt+b3PIoifq+btBDKekzX3Q2CBcxSHvg6p0/ kIhXYVr6yaymmLT43pbIU+PX+OLWnp0yKjdAyskyOzdQz0/r6XwFlhy+fvM4s96Q6zCHM3 yDQUZm0c01SFx7p46VfzCf9kIdGAVSg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-kSE6BjvrPoOLAwciouTUvg-1; Tue, 16 May 2023 04:10:14 -0400 X-MC-Unique: kSE6BjvrPoOLAwciouTUvg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C89A187DC08; Tue, 16 May 2023 08:10:13 +0000 (UTC) Received: from localhost (ovpn-13-34.pek2.redhat.com [10.72.13.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 55C1B40C6EC4; Tue, 16 May 2023 08:10:10 +0000 (UTC) Date: Tue, 16 May 2023 16:10:07 +0800 From: Baoquan He To: Thomas Gleixner Cc: Uladzislau Rezki , Andrew Morton , linux-mm@kvack.org, Christoph Hellwig , Lorenzo Stoakes , Peter Zijlstra , John Ogness , linux-arm-kernel@lists.infradead.org, Russell King , Mark Rutland , Marc Zyngier Subject: Re: Excessive TLB flush ranges Message-ID: References: <87a5y5a6kj.ffs@tglx> <87o7mk93tc.ffs@tglx> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_011021_239544_11359C3A X-CRM114-Status: GOOD ( 24.28 ) 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 On 05/16/23 at 04:07pm, Baoquan He wrote: > On 05/16/23 at 08:40am, Thomas Gleixner wrote: > > On Tue, May 16 2023 at 10:26, Baoquan He wrote: > > > On 05/15/23 at 08:17pm, Uladzislau Rezki wrote: > > >> For systems which lack a full TLB flush and to flush a long range is > > >> a problem(it takes time), probably we can flush VA one by one. Because > > >> currently we calculate a flush range [min:max] and that range includes > > >> the space that might not be mapped at all. Like below: > > > > > > It's fine if we only calculate a flush range of [min:max] with VA. In > > > vm_reset_perms(), it calculates the flush range with the impacted direct > > > mapping range, then merge it with VA's range. That looks really strange > > > and surprising. If the vm->pages[] are got from a lower part of physical > > > memory, the final merged flush will span tremendous range. Wondering why > > > we need merge the direct map range with VA range, then do flush. Not > > > sure if I misunderstand it. > > > > So what happens on this BPF teardown is: > > > > The vfree(8k) ends up flushing 3 entries. The actual vmalloc part (2) and > > one extra which is in the direct map. I haven't verified that yet, but I > > assume it's the alias of one of the vmalloc'ed pages. > > It looks like the reason. As Uladzislau pointed out, ARCH-es may > have full TLB flush, so won't get trouble from the merged flush > in the calculated [min:max] way, e.g arm64 and x86's flush_tlb_kernel_range(). > However, arm32 seems lacking the ability of full TLB flash. If agreed, I > can make a draft patch to do the flush for direct map and VA seperately, > see if it works. Ah, didn't notice there's draft patch under discussing in another sub-thread, please ignore this mail. Will check that sub-thread. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel