Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2254773ybd; Mon, 24 Jun 2019 03:23:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQylwbUfv8qSAHSnsRcBfFCBcvTqqbTwwdkqcubqCBquJ6LjP+ifSmpP+oM+fAil+9yoJB X-Received: by 2002:a65:5c47:: with SMTP id v7mr21062317pgr.44.1561371800162; Mon, 24 Jun 2019 03:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371800; cv=none; d=google.com; s=arc-20160816; b=IYc0pxwiA037Sgu0bvpuyJJqktlZYOdPsYVlu6pRRQVhkxbYTv5pRV0GF0UWz1oBhG Wjl7UK7mR1TkIHAS0hs70X9oEM7I9y5YdnVEuZJYh1cq0g9EUzHzgBCa9cU3qxnydIbg Lh8A6ZEfIG64egGlYu4i28RN2YLlA252HCaZ4RDTgIp4zxLKruEjgxkZ9ApNQhajxzag YJrR4rP6Fwv8eR9IvDVCeOVcanaIKsI2EEcsah0Xr5grd+8JyPkF31LpKLzU7EVE+dFZ pGuOZlPihNbhwlAb3eqFnrRi0s+M1fA/oCYVIteiVSS4R5MWqGlVld/WXaO9uTNc6RaC UgsA== 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:dkim-signature; bh=Bo1hhwrtbBBOaheMbiz4txk7aH9Rmw0FTgZkDodokiM=; b=CLTebIepkii4hY5yNh2WpBhuk0qEovadmPxhqemxKyEot9UftUSQjtw3ODjHvIViks dmOqOxGBblWQLxwpkHJfdkg2OdB1ITh/hxxV+0j9IgFv5Y+XLCp9F+TgxOIZKARuKB8d FwgwxLx8SDtxh9we3LDM1jfgjmvua+UumwLjbvjZ/TjAi9b1LaPdWY8qsuoiMiaf6woa RnpB6Nhlgs5DnqtkP39jRAmoZKs5gomO9+5/QrrKGVW3d6mHbYeZIMG8LiwsWvx3MatG 5NHwUKBxK9rxElQZCAj+C+2sHX1IRE3LogUyKd3WbjpWATkTAwBqRW+V+J61Clpiujzi IfNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JwiHHdW7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70si9891170plc.253.2019.06.24.03.23.04; Mon, 24 Jun 2019 03:23:20 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JwiHHdW7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731103AbfFXKWU (ORCPT + 99 others); Mon, 24 Jun 2019 06:22:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:58152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731092AbfFXKWR (ORCPT ); Mon, 24 Jun 2019 06:22:17 -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 691F9208E4; Mon, 24 Jun 2019 10:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371736; bh=d4H3ytDN4+6bzOFsrB7H72D5xnyH2d7DzxF9eKjN0sY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JwiHHdW7tU89KwjK81T7yWoMzvqANGQZczB5UCgT2eBTMTSj/2WtBXwPLu9Bm31O5 r/b9kyNOheWOPU6eueHBoKQB11SLCVWYnVhoKTq/4mVb1bd1PgiaqOudYcyxSqF2PT S4tMcKDxPqFg/3U3pumEBb3BDhOvWlvqmdZEXn2I= Date: Mon, 24 Jun 2019 11:22:10 +0100 From: Will Deacon To: Guo Ren Cc: Catalin Marinas , julien.thierry@arm.com, aou@eecs.berkeley.edu, james.morse@arm.com, suzuki.poulose@arm.com, Marc Zyngier , Anup Patel , Will Deacon , linux-kernel@vger.kernel.org, rppt@linux.ibm.com, hch@infradead.org, Atish Patra , Julien Grall , Palmer Dabbelt , gary@garyguo.net, paul.walmsley@sifive.com, christoffer.dall@arm.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: <20190624102209.ngwtosgr5fvp3ler@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> 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 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 still think this is over-engineered for what you want on c-sky and making this code generic is a mistake. Will