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 X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84E27C48BD7 for ; Thu, 27 Jun 2019 10:27:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59E8B2086D for ; Thu, 27 Jun 2019 10:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561631226; bh=+aboWwW7RRRk1C/RYk5UOWQp4PDh2UA+to5qKLSsG5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=ccBq5jTTSlubweNGQmiY4jcp0GfKtMdaAl74k8rY64R7r+mhzzNkfFjVak4qWrWVu gfYstQs7JoagmZipMYcy1RmuEZLz/yscX10T6UaBdVVgINBf1denHBqaXhzMq7ymVg 2d7fqZEwzwfa1ufVlVMq9PvQafEM4Fj/Y5cm2Y6M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbfF0K1F (ORCPT ); Thu, 27 Jun 2019 06:27:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:52622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbfF0K1E (ORCPT ); Thu, 27 Jun 2019 06:27:04 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F00C420828; Thu, 27 Jun 2019 10:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561631223; bh=+aboWwW7RRRk1C/RYk5UOWQp4PDh2UA+to5qKLSsG5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ufNNsQ7PR/cG5oM3QhBjje8hgBKvThE0uaI9H9xM3+okTUjOvbrBIYQPnqnHbRbNy 0t+KK8xaWhxO0Sb25thuG7jRqSWjh7gyuw+7eiQuFz4Jnys7TskYd/ZdNopyXT4nnP fsmY0hf/CSX8CAYEu4OwsGjutyiF0uZfK+cHA1lY= Date: Thu, 27 Jun 2019 11:26:57 +0100 From: Will Deacon To: "qi.fuli@fujitsu.com" Cc: Guo Ren , Julien Grall , "aou@eecs.berkeley.edu" , "suzuki.poulose@arm.com" , Marc Zyngier , Catalin Marinas , "julien.thierry@arm.com" , Will Deacon , "linux-kernel@vger.kernel.org" , "rppt@linux.ibm.com" , "hch@infradead.org" , Atish Patra , Anup Patel , "james.morse@arm.com" , "gary@garyguo.net" , Palmer Dabbelt , "christoffer.dall@arm.com" , "paul.walmsley@sifive.com" , "linux-riscv@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a separate file Message-ID: <20190627102656.elizqwby4sw4vi5j@willie-the-truck> References: <20190321163623.20219-1-julien.grall@arm.com> <20190321163623.20219-12-julien.grall@arm.com> <0dfe120b-066a-2ac8-13bc-3f5a29e2caa3@arm.com> <20190621141606.GF18954@arrakis.emea.arm.com> <20190624102209.ngwtosgr5fvp3ler@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 27, 2019 at 09:41:42AM +0000, qi.fuli@fujitsu.com wrote: > > On 6/24/19 7:22 PM, Will Deacon wrote: > > On Mon, Jun 24, 2019 at 12:35:35AM +0800, Guo Ren wrote: > >> On Fri, Jun 21, 2019 at 10:16 PM Catalin Marinas > >> wrote: > >>> On Wed, Jun 19, 2019 at 07:51:03PM +0800, Guo Ren wrote: > >>>> On Wed, Jun 19, 2019 at 4:54 PM Julien Grall wrote: > >>>>> On 6/19/19 9:07 AM, Guo Ren wrote: > >>>>>> Move arm asid allocator code in a generic one is a agood idea, I've > >>>>>> made a patchset for C-SKY and test is on processing, See: > >>>>>> https://lore.kernel.org/linux-csky/1560930553-26502-1-git-send-email-guoren@kernel.org/ > >>>>>> > >>>>>> If you plan to seperate it into generic one, I could co-work with you. > >>>>> Was the ASID allocator work out of box on C-Sky? > >>>> Almost done, but one question: > >>>> arm64 remove the code in switch_mm: > >>>> cpumask_clear_cpu(cpu, mm_cpumask(prev)); > >>>> cpumask_set_cpu(cpu, mm_cpumask(next)); > >>>> > >>>> Why? Although arm64 cache operations could affect all harts with CTC > >>>> method of interconnect, I think we should keep these code for > >>>> primitive integrity in linux. Because cpu_bitmap is in mm_struct > >>>> instead of mm->context. > >>> We didn't have a use for this in the arm64 code, so no point in > >>> maintaining the mm_cpumask. On some arm32 systems (ARMv6) with no > >>> hardware broadcast of some TLB/cache operations, we use it to track > >>> where the task has run to issue IPI for TLB invalidation or some > >>> deferred I-cache invalidation. > >> The operation of set/clear mm_cpumask was removed in arm64 compared to > >> arm32. It seems no side effect on current arm64 system, but from > >> software meaning it's wrong. > >> I think we should keep mm_cpumask just like arm32. > > It was a while ago now, but I remember the atomic update of the mm_cpumask > > being quite expensive when I was profiling this stuff, so I removed it > > because we don't need it for arm64 (at least, it doesn't allow us to > > optimise our shootdowns in practice). > > I think mm_cpumask can be used for filtering the cpus that there are TBL > entries on. I'm aware that you want to use IPIs for broadcasting TLB invalidation but that is only tangentially related to this thread, which is about the current ASID algorithm and the need to update mm_cpumask today. Please don't conflate the two threads; I already made my position reasonably clear: https://lore.kernel.org/linux-arm-kernel/20190617170328.GJ30800@fuggles.cambridge.arm.com/ I will follow-up with another reply there. Will 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 X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E16C48BD7 for ; Thu, 27 Jun 2019 10:27:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8683B20828 for ; Thu, 27 Jun 2019 10:27:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jI9gIgAt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ufNNsQ7P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8683B20828 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=JEH7tC1+ZZzjIwF9HraeD4Yjk4o9Rbss5eUL/1jL6N0=; b=jI9gIgAtY4OMqd tMVVw04Xe8Vqb+2Y6zDcTxUThWEX9ru3nSEtjsNInDGnCJPj5vj+/uhTko/Rr7Dh+lxRhnAIdXU0b 7yO0rACiFrb9bLw9t3a9Tdnj4wjizt7fimx1CUQpM++zAFf9EBHOqCTquQ0i04Jj9KkUwiriuSGou biV8oD63ZNY6mZcIihhczcgNIHt6HepdlSosD6Drf7aBVyceyLwGVGeHsxJeLCxZN62P0O3kfv7Rw rcyro5U4h8OaCpg0kh7XwLkEMsCmBe9Sx6sFvMTaSJdf15hbPVyeulst6+gf3fqZOBs0T5sxA/cRH 8EWSzY7YT8o2gTAtSFDA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgRct-00042O-ST; Thu, 27 Jun 2019 10:27:36 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgRcN-0003kb-Rl; Thu, 27 Jun 2019 10:27:05 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F00C420828; Thu, 27 Jun 2019 10:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561631223; bh=+aboWwW7RRRk1C/RYk5UOWQp4PDh2UA+to5qKLSsG5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ufNNsQ7PR/cG5oM3QhBjje8hgBKvThE0uaI9H9xM3+okTUjOvbrBIYQPnqnHbRbNy 0t+KK8xaWhxO0Sb25thuG7jRqSWjh7gyuw+7eiQuFz4Jnys7TskYd/ZdNopyXT4nnP fsmY0hf/CSX8CAYEu4OwsGjutyiF0uZfK+cHA1lY= Date: Thu, 27 Jun 2019 11:26:57 +0100 From: Will Deacon To: "qi.fuli@fujitsu.com" Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a separate file Message-ID: <20190627102656.elizqwby4sw4vi5j@willie-the-truck> References: <20190321163623.20219-1-julien.grall@arm.com> <20190321163623.20219-12-julien.grall@arm.com> <0dfe120b-066a-2ac8-13bc-3f5a29e2caa3@arm.com> <20190621141606.GF18954@arrakis.emea.arm.com> <20190624102209.ngwtosgr5fvp3ler@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_032703_995987_78997B50 X-CRM114-Status: GOOD ( 20.38 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "aou@eecs.berkeley.edu" , "suzuki.poulose@arm.com" , Marc Zyngier , Catalin Marinas , "julien.thierry@arm.com" , Will Deacon , "linux-kernel@vger.kernel.org" , "rppt@linux.ibm.com" , "hch@infradead.org" , Atish Patra , Julien Grall , Anup Patel , Guo Ren , "gary@garyguo.net" , Palmer Dabbelt , "christoffer.dall@arm.com" , "james.morse@arm.com" , "linux-riscv@lists.infradead.org" , "paul.walmsley@sifive.com" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Thu, Jun 27, 2019 at 09:41:42AM +0000, qi.fuli@fujitsu.com wrote: > > On 6/24/19 7:22 PM, Will Deacon wrote: > > On Mon, Jun 24, 2019 at 12:35:35AM +0800, Guo Ren wrote: > >> On Fri, Jun 21, 2019 at 10:16 PM Catalin Marinas > >> wrote: > >>> On Wed, Jun 19, 2019 at 07:51:03PM +0800, Guo Ren wrote: > >>>> On Wed, Jun 19, 2019 at 4:54 PM Julien Grall wrote: > >>>>> On 6/19/19 9:07 AM, Guo Ren wrote: > >>>>>> Move arm asid allocator code in a generic one is a agood idea, I've > >>>>>> made a patchset for C-SKY and test is on processing, See: > >>>>>> https://lore.kernel.org/linux-csky/1560930553-26502-1-git-send-email-guoren@kernel.org/ > >>>>>> > >>>>>> If you plan to seperate it into generic one, I could co-work with you. > >>>>> Was the ASID allocator work out of box on C-Sky? > >>>> Almost done, but one question: > >>>> arm64 remove the code in switch_mm: > >>>> cpumask_clear_cpu(cpu, mm_cpumask(prev)); > >>>> cpumask_set_cpu(cpu, mm_cpumask(next)); > >>>> > >>>> Why? Although arm64 cache operations could affect all harts with CTC > >>>> method of interconnect, I think we should keep these code for > >>>> primitive integrity in linux. Because cpu_bitmap is in mm_struct > >>>> instead of mm->context. > >>> We didn't have a use for this in the arm64 code, so no point in > >>> maintaining the mm_cpumask. On some arm32 systems (ARMv6) with no > >>> hardware broadcast of some TLB/cache operations, we use it to track > >>> where the task has run to issue IPI for TLB invalidation or some > >>> deferred I-cache invalidation. > >> The operation of set/clear mm_cpumask was removed in arm64 compared to > >> arm32. It seems no side effect on current arm64 system, but from > >> software meaning it's wrong. > >> I think we should keep mm_cpumask just like arm32. > > It was a while ago now, but I remember the atomic update of the mm_cpumask > > being quite expensive when I was profiling this stuff, so I removed it > > because we don't need it for arm64 (at least, it doesn't allow us to > > optimise our shootdowns in practice). > > I think mm_cpumask can be used for filtering the cpus that there are TBL > entries on. I'm aware that you want to use IPIs for broadcasting TLB invalidation but that is only tangentially related to this thread, which is about the current ASID algorithm and the need to update mm_cpumask today. Please don't conflate the two threads; I already made my position reasonably clear: https://lore.kernel.org/linux-arm-kernel/20190617170328.GJ30800@fuggles.cambridge.arm.com/ I will follow-up with another reply there. Will _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAB5EC48BD7 for ; Thu, 27 Jun 2019 10:27:10 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 3A11720828 for ; Thu, 27 Jun 2019 10:27:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ufNNsQ7P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A11720828 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B3CF04A507; Thu, 27 Jun 2019 06:27:09 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eCoeKktnJu3y; Thu, 27 Jun 2019 06:27:07 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9217B4A4C1; Thu, 27 Jun 2019 06:27:07 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id CC68A4A4BE for ; Thu, 27 Jun 2019 06:27:05 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bEztsQdarDlX for ; Thu, 27 Jun 2019 06:27:04 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8FC884A49F for ; Thu, 27 Jun 2019 06:27:04 -0400 (EDT) Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F00C420828; Thu, 27 Jun 2019 10:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561631223; bh=+aboWwW7RRRk1C/RYk5UOWQp4PDh2UA+to5qKLSsG5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ufNNsQ7PR/cG5oM3QhBjje8hgBKvThE0uaI9H9xM3+okTUjOvbrBIYQPnqnHbRbNy 0t+KK8xaWhxO0Sb25thuG7jRqSWjh7gyuw+7eiQuFz4Jnys7TskYd/ZdNopyXT4nnP fsmY0hf/CSX8CAYEu4OwsGjutyiF0uZfK+cHA1lY= Date: Thu, 27 Jun 2019 11:26:57 +0100 From: Will Deacon To: "qi.fuli@fujitsu.com" Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a separate file Message-ID: <20190627102656.elizqwby4sw4vi5j@willie-the-truck> References: <20190321163623.20219-1-julien.grall@arm.com> <20190321163623.20219-12-julien.grall@arm.com> <0dfe120b-066a-2ac8-13bc-3f5a29e2caa3@arm.com> <20190621141606.GF18954@arrakis.emea.arm.com> <20190624102209.ngwtosgr5fvp3ler@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Cc: "aou@eecs.berkeley.edu" , Marc Zyngier , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , "rppt@linux.ibm.com" , "hch@infradead.org" , Atish Patra , Julien Grall , Anup Patel , Guo Ren , "gary@garyguo.net" , Palmer Dabbelt , "linux-riscv@lists.infradead.org" , "paul.walmsley@sifive.com" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Thu, Jun 27, 2019 at 09:41:42AM +0000, qi.fuli@fujitsu.com wrote: > > On 6/24/19 7:22 PM, Will Deacon wrote: > > On Mon, Jun 24, 2019 at 12:35:35AM +0800, Guo Ren wrote: > >> On Fri, Jun 21, 2019 at 10:16 PM Catalin Marinas > >> wrote: > >>> On Wed, Jun 19, 2019 at 07:51:03PM +0800, Guo Ren wrote: > >>>> On Wed, Jun 19, 2019 at 4:54 PM Julien Grall wrote: > >>>>> On 6/19/19 9:07 AM, Guo Ren wrote: > >>>>>> Move arm asid allocator code in a generic one is a agood idea, I've > >>>>>> made a patchset for C-SKY and test is on processing, See: > >>>>>> https://lore.kernel.org/linux-csky/1560930553-26502-1-git-send-email-guoren@kernel.org/ > >>>>>> > >>>>>> If you plan to seperate it into generic one, I could co-work with you. > >>>>> Was the ASID allocator work out of box on C-Sky? > >>>> Almost done, but one question: > >>>> arm64 remove the code in switch_mm: > >>>> cpumask_clear_cpu(cpu, mm_cpumask(prev)); > >>>> cpumask_set_cpu(cpu, mm_cpumask(next)); > >>>> > >>>> Why? Although arm64 cache operations could affect all harts with CTC > >>>> method of interconnect, I think we should keep these code for > >>>> primitive integrity in linux. Because cpu_bitmap is in mm_struct > >>>> instead of mm->context. > >>> We didn't have a use for this in the arm64 code, so no point in > >>> maintaining the mm_cpumask. On some arm32 systems (ARMv6) with no > >>> hardware broadcast of some TLB/cache operations, we use it to track > >>> where the task has run to issue IPI for TLB invalidation or some > >>> deferred I-cache invalidation. > >> The operation of set/clear mm_cpumask was removed in arm64 compared to > >> arm32. It seems no side effect on current arm64 system, but from > >> software meaning it's wrong. > >> I think we should keep mm_cpumask just like arm32. > > It was a while ago now, but I remember the atomic update of the mm_cpumask > > being quite expensive when I was profiling this stuff, so I removed it > > because we don't need it for arm64 (at least, it doesn't allow us to > > optimise our shootdowns in practice). > > I think mm_cpumask can be used for filtering the cpus that there are TBL > entries on. I'm aware that you want to use IPIs for broadcasting TLB invalidation but that is only tangentially related to this thread, which is about the current ASID algorithm and the need to update mm_cpumask today. Please don't conflate the two threads; I already made my position reasonably clear: https://lore.kernel.org/linux-arm-kernel/20190617170328.GJ30800@fuggles.cambridge.arm.com/ I will follow-up with another reply there. Will _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 671E5C48BD6 for ; Thu, 27 Jun 2019 10:27:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3E0A22086D for ; Thu, 27 Jun 2019 10:27:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CecNWuYi"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ufNNsQ7P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E0A22086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=ORjcjOURj6t0+fpYSbBvNW+PTZCXOwUrd2eEf5S4iGk=; b=CecNWuYiZVtwkN Ei2Uo2RsCOtFNNFCNJb67gNuaKy7uGbJONn65xEfmymTrmTqN99ULWAsGopXHjhsmKRCJ9dxfaslM hLu4rKQx7abszU6OnfyWAsHQJhiM5xbda1h/YQxmKCD/R7baPnphEMDNNJkx3RBUXcmaB+2LqRZWY vq+JGe1ghlMUtwW6c3mkh2zC+v9u4AcmFxprZc0kV6nGd457ud26bUvg+sGJztglPDMHfWP0KGnaR yfX6edsP3gmV+3SkQN2tOZmDM919AL0P4IsgQnx191L1NurdQy+wlUnHmHp9KTpS56+BOaIWKCevD 1o7qyA31n+M/vAlxDnUA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgRcU-0003n3-G5; Thu, 27 Jun 2019 10:27:10 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgRcN-0003kb-Rl; Thu, 27 Jun 2019 10:27:05 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F00C420828; Thu, 27 Jun 2019 10:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561631223; bh=+aboWwW7RRRk1C/RYk5UOWQp4PDh2UA+to5qKLSsG5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ufNNsQ7PR/cG5oM3QhBjje8hgBKvThE0uaI9H9xM3+okTUjOvbrBIYQPnqnHbRbNy 0t+KK8xaWhxO0Sb25thuG7jRqSWjh7gyuw+7eiQuFz4Jnys7TskYd/ZdNopyXT4nnP fsmY0hf/CSX8CAYEu4OwsGjutyiF0uZfK+cHA1lY= Date: Thu, 27 Jun 2019 11:26:57 +0100 From: Will Deacon To: "qi.fuli@fujitsu.com" Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a separate file Message-ID: <20190627102656.elizqwby4sw4vi5j@willie-the-truck> References: <20190321163623.20219-1-julien.grall@arm.com> <20190321163623.20219-12-julien.grall@arm.com> <0dfe120b-066a-2ac8-13bc-3f5a29e2caa3@arm.com> <20190621141606.GF18954@arrakis.emea.arm.com> <20190624102209.ngwtosgr5fvp3ler@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_032703_995987_78997B50 X-CRM114-Status: GOOD ( 20.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "aou@eecs.berkeley.edu" , "suzuki.poulose@arm.com" , Marc Zyngier , Catalin Marinas , "julien.thierry@arm.com" , Will Deacon , "linux-kernel@vger.kernel.org" , "rppt@linux.ibm.com" , "hch@infradead.org" , Atish Patra , Julien Grall , Anup Patel , Guo Ren , "gary@garyguo.net" , Palmer Dabbelt , "christoffer.dall@arm.com" , "james.morse@arm.com" , "linux-riscv@lists.infradead.org" , "paul.walmsley@sifive.com" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 27, 2019 at 09:41:42AM +0000, qi.fuli@fujitsu.com wrote: > > On 6/24/19 7:22 PM, Will Deacon wrote: > > On Mon, Jun 24, 2019 at 12:35:35AM +0800, Guo Ren wrote: > >> On Fri, Jun 21, 2019 at 10:16 PM Catalin Marinas > >> wrote: > >>> On Wed, Jun 19, 2019 at 07:51:03PM +0800, Guo Ren wrote: > >>>> On Wed, Jun 19, 2019 at 4:54 PM Julien Grall wrote: > >>>>> On 6/19/19 9:07 AM, Guo Ren wrote: > >>>>>> Move arm asid allocator code in a generic one is a agood idea, I've > >>>>>> made a patchset for C-SKY and test is on processing, See: > >>>>>> https://lore.kernel.org/linux-csky/1560930553-26502-1-git-send-email-guoren@kernel.org/ > >>>>>> > >>>>>> If you plan to seperate it into generic one, I could co-work with you. > >>>>> Was the ASID allocator work out of box on C-Sky? > >>>> Almost done, but one question: > >>>> arm64 remove the code in switch_mm: > >>>> cpumask_clear_cpu(cpu, mm_cpumask(prev)); > >>>> cpumask_set_cpu(cpu, mm_cpumask(next)); > >>>> > >>>> Why? Although arm64 cache operations could affect all harts with CTC > >>>> method of interconnect, I think we should keep these code for > >>>> primitive integrity in linux. Because cpu_bitmap is in mm_struct > >>>> instead of mm->context. > >>> We didn't have a use for this in the arm64 code, so no point in > >>> maintaining the mm_cpumask. On some arm32 systems (ARMv6) with no > >>> hardware broadcast of some TLB/cache operations, we use it to track > >>> where the task has run to issue IPI for TLB invalidation or some > >>> deferred I-cache invalidation. > >> The operation of set/clear mm_cpumask was removed in arm64 compared to > >> arm32. It seems no side effect on current arm64 system, but from > >> software meaning it's wrong. > >> I think we should keep mm_cpumask just like arm32. > > It was a while ago now, but I remember the atomic update of the mm_cpumask > > being quite expensive when I was profiling this stuff, so I removed it > > because we don't need it for arm64 (at least, it doesn't allow us to > > optimise our shootdowns in practice). > > I think mm_cpumask can be used for filtering the cpus that there are TBL > entries on. I'm aware that you want to use IPIs for broadcasting TLB invalidation but that is only tangentially related to this thread, which is about the current ASID algorithm and the need to update mm_cpumask today. Please don't conflate the two threads; I already made my position reasonably clear: https://lore.kernel.org/linux-arm-kernel/20190617170328.GJ30800@fuggles.cambridge.arm.com/ I will follow-up with another reply there. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel