Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1361602rda; Mon, 23 Oct 2023 10:08:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1UNVsKV90kP5QcJoSGeVMmeXeupHwdJ2CLSvru3ASgguvzN0jdnScoOafS8Bye+er/QLw X-Received: by 2002:a05:6871:4683:b0:1e9:ccec:645a with SMTP id ni3-20020a056871468300b001e9ccec645amr11274678oab.44.1698080921579; Mon, 23 Oct 2023 10:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698080921; cv=none; d=google.com; s=arc-20160816; b=vAk2kU7bFGIQfgMivphCJTFE+fz03Y0E62t6vrv4My7Vivu/MjpTNjrlqjSlmNPzc9 r8zpMSH5QRNdQT5barkwEkaoolJSAEj/m1Ccw6+IZyV2u81DeRrhXNIVnAJ3KAj8oERf +RvHBEzFwz0pYlk2uuDhsTjkuyvdqP+Wb2NQhLmj5lxZpZ1jWzpXxHumNWXo3iDt6ile NzP2Vdkj76CDFm6kk2zOGXSDqT6gai9asV/wp8IN4k9AJOCKpslNg3hV/8xSR6EKAWq2 ohhHwP7cloQ0bYiK+prW8xW0qKClwL7HTsE+IBYv8quq/JaYjAeV+/5Z2SxBQuGv90En xZCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=THF0re05WZ1UGLXn2a9ASKWd0QScSjUwIesgDWAQxWA=; fh=x2JX/lyPZZe/EaW82ecRWOe1Ml7rHoicX+cUXB5VlGI=; b=frfUz6djIuwYsmx9Je6ORP5SBFCl/qfWKq95AYkKx6mkX/IIa6mYMG5oY0SHJz8f+l GF+TMAwDQUGau2gDDySVRGR0ouUjdaZiiOWp2U88vR8CC758OzyslMbK1ybvoKndBxdw yzlCM+c8AVcqnENUl0qbVQkmQGr6EZsBGoP47sfkQSf0jjXHckBjtY+LtLSDDgZhxz42 DQSkerylAMMo27tjtzd96fAGnMnQKE06a1DuLYYr1XXUWtMFzhgTJ6oRO3c77I3SPjs0 sys+7H4YwBh8FkjB0nJ27Ke9uMZyHmakKSmnQio4SOLEob3FIj9MEl2qVUhUh/FC5tqi k8ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w63-20020a638242000000b005a1d8815fefsi6594078pgd.187.2023.10.23.10.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 10:08:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E3964804E444; Mon, 23 Oct 2023 10:08:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjJWRIg (ORCPT + 99 others); Mon, 23 Oct 2023 13:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjJWRIf (ORCPT ); Mon, 23 Oct 2023 13:08:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D73AFD79; Mon, 23 Oct 2023 10:08:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EBAEC433C8; Mon, 23 Oct 2023 17:08:24 +0000 (UTC) Date: Mon, 23 Oct 2023 18:08:21 +0100 From: Catalin Marinas To: David Hildenbrand Cc: Hyesoo Yu , Alexandru Elisei , will@kernel.org, oliver.upton@linux.dev, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, arnd@arndb.de, akpm@linux-foundation.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, mhiramat@kernel.org, rppt@kernel.org, hughd@google.com, pcc@google.com, steven.price@arm.com, anshuman.khandual@arm.com, vincenzo.frascino@arm.com, eugenis@google.com, kcc@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH RFC 06/37] mm: page_alloc: Allocate from movable pcp lists only if ALLOC_FROM_METADATA Message-ID: References: <20230823131350.114942-1-alexandru.elisei@arm.com> <20230823131350.114942-7-alexandru.elisei@arm.com> <20231010074823.GA2536665@tiffany> <20231023071656.GA344850@tiffany> <25fad62e-b1d9-4d63-9d95-08c010756231@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25fad62e-b1d9-4d63-9d95-08c010756231@redhat.com> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 10:08:40 -0700 (PDT) On Mon, Oct 23, 2023 at 01:55:12PM +0200, David Hildenbrand wrote: > On 23.10.23 12:50, Catalin Marinas wrote: > > On Mon, Oct 23, 2023 at 04:16:56PM +0900, Hyesoo Yu wrote: > > > Does tag storage itself supports tagging? Will the following version be unusable > > > if the hardware does not support it? The document of google said that > > > "If this memory is itself mapped as Tagged Normal (which should not happen!) > > > then tag updates on it either raise a fault or do nothing, but never change the > > > contents of any other page." > > > (https://github.com/google/sanitizers/blob/master/mte-dynamic-carveout/spec.md) > > > > > > The support of H/W is very welcome because it is good to make the patches simpler. > > > But if H/W doesn't support it, Can't the new solution be used? > > > > AFAIK on the current interconnects this is supported but the offsets > > will need to be configured by firmware in such a way that a tag access > > to the tag carve-out range still points to physical RAM, otherwise, as > > per Google's doc, you can get some unexpected behaviour. [...] > I followed what you are saying, but I didn't quite read the following > clearly stated in your calculations: Using this model, how much memory would > you be able to reuse, and how much not? > > I suspect you would *not* be able to reuse "1/(32*32)" [second carve-out] > but be able to reuse "1/32 - 1/(32*32)" [first carve-out] or am I completely > off? That's correct. In theory, from the hardware perspective, we could even go recursively to the third/fourth etc. carveout until the last one is a single page but I'd rather not complicate things further. > Further, (just thinking about it) I assume you've taken care of the > condition that memory cannot self-host it's own tag memory. So that cannot > happen in the model proposed here, right? I don't fully understand what you mean. The tags for the first data range (0 .. ram_size * 31/32) are stored in the first tag carveout. That's where we'll need CMA. For the tag carveout, when hosting data pages as tagged, the tags go in the second carveout which is fully reserved (still TBD but possibly the firmware won't even tell the kernel about it). -- Catalin