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 B8AC4C77B7A for ; Fri, 19 May 2023 14:14:10 +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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q/aQpXfcTNRARZrL5ZORhj2+yTqHCi7tjCbduFnrYmo=; b=kU1hygR2T7JC/K E18PDP5OIz+o0D0wcPWf4d6DzMs+1ir9T03e+AUhnI9O9VEThydO+csJ2u/NMp50y9b5pkpo4M7j6 s8FIDF0GE7303c/BS799zeDOwh2AojaOVmuaFFUTryvIMQnVgRmz+wdtOSPNoBcvUk0c2RZOJeLwB xxdCXo5RDaG4FIP5aFgy1T4/nKODyEoxMrHPFkcs9kvrrdx9/oDZs1o+ji0xo+eYfpk+1VfXhC0O4 YUOy+E8cZ5scvV0VudqevKI1LbbQevPDUTMxa6Kc8QPK7xE81UCfizDnP44nyh9B2HJ+/fZNAS7vZ cJx6gOKRf1+D1uD2RyKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q00rc-00GSXE-36; Fri, 19 May 2023 14:13:48 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q00rZ-00GSWO-2F for linux-arm-kernel@lists.infradead.org; Fri, 19 May 2023 14:13:47 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684505624; 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=Cf30QsArGlvD7J2wXvNnYAEQk2qn+mQ9OE81QDm7yEw=; b=M7JUkFlScgAHLKCbUeZuMy1Awt7SXaQD2H5F0k7ZkYgjIVjuyKak2oEW+O6tM/OpQg+wiI EflZhsDMPJVIfAQbEXQdk620cFMgLJcMQjBxb3TJQkmlNyYMMLAzNn6D6awOiDc8wX02ws 0V4SM1efp5qZlF+f+VQMLsIK2+L6i/N64ReSNYVoW1rLgB55JOmnjkfFoaIJiE8QerOOTo BFgU15aonVxQZ+OYlcEbhsi2vk8f8oXFL+jJbtRMfa9yAtQjfqTHeta4q3ihYasaK4/bmK elpI8fhKNTpKO9WjiaHEBgX3QBAUFdm4jSl41Bmc/imt6t3XOUy5aqiYtcQRUQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684505624; 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=Cf30QsArGlvD7J2wXvNnYAEQk2qn+mQ9OE81QDm7yEw=; b=62EW2RYRJ2LMSby3ZKwRctvzyIV0IJLjjxf+uVz1bggPghrCk6rIXaDo86zS5mbe+6w2mF 2vrTZv+S2QeKKCCQ== To: Baoquan He Cc: "Russell King (Oracle)" , Andrew Morton , linux-mm@kvack.org, Christoph Hellwig , Uladzislau Rezki , Lorenzo Stoakes , Peter Zijlstra , John Ogness , linux-arm-kernel@lists.infradead.org, Mark Rutland , Marc Zyngier , x86@kernel.org Subject: Re: Excessive TLB flush ranges In-Reply-To: References: <87ilcs8zab.ffs@tglx> <87fs7w8z6y.ffs@tglx> <874joc8x7d.ffs@tglx> <87r0rg73wp.ffs@tglx> <87edng6qu8.ffs@tglx> <87y1ln5md2.ffs@tglx> <875y8o5zwm.ffs@tglx> Date: Fri, 19 May 2023 16:13:43 +0200 Message-ID: <87ttw84dew.ffs@tglx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230519_071345_892727_D03435E3 X-CRM114-Status: GOOD ( 15.66 ) 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 Fri, May 19 2023 at 19:49, Baoquan He wrote: > On 05/19/23 at 01:22pm, Thomas Gleixner wrote: >> > >> > When vb_free() is invoked, it could cause three kinds of vmap_block as >> > below. Your code works well for the 2nd case, for the 1st one, it may be >> > not. And the 2nd one is the stuff that we reclaim and put into purge >> > list in purge_fragmented_blocks_allcpus(). >> > >> > 1) >> > |-----|------------|-----------|-------| >> > |dirty|still mapped| dirty | free | >> > >> > 2) >> > |------------------------------|-------| >> > | dirty | free | >> >> >> You sure? The first one is put into the purge list too. > > No way. You don't copy the essential code here. The key line is > calculation of vb->dirty. ->dirty_min and ->dirty_max only provides a > loose vlaue for calculating the flush range. Counting more or less page > of ->dirty_min or ->dirty_max won't impact much, just make flush do > some menningless operation. While counting ->dirty wrong will cause > serious problem. If you put case 1 into purge list, freeing it later > will fail because you can't find it in vmap_area_root tree. Please check > vfree() and remove_vm_area(). I misread your mail. My point was soleley about the ranges which get flushed via unmap_aliases() before the block is completely freed, i.e. ->free = 0 and ->dirty = VMAP_BBMAP_BITS. Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel