Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp2068585rdb; Wed, 31 Jan 2024 19:32:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGB2x1lK81gCAp7OoxcLO3aM7l27Hv7nn4UB04vpQHEX0dQpvuqRPEqwV8+8lddNrkb/Uj4 X-Received: by 2002:a05:6808:1708:b0:3be:6e83:6467 with SMTP id bc8-20020a056808170800b003be6e836467mr1133611oib.41.1706758359316; Wed, 31 Jan 2024 19:32:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706758359; cv=pass; d=google.com; s=arc-20160816; b=HWI2ZDbkZydcdZUe1njtSqdPsYeFxrpGJJo1JpeRs4VS+kt1Yc6+vvVh+vJfXXRtYx Y6BC5t6RHEH3ETF8Cm1UWjSCeiR0AnFfYIS7SEv+cvgDsC53J2vDyr6Q+K+9lDpt7pIg zZKj5fw1g+D4mLM4zIhgt7HQAtjXprKMme4uH7LE87JwOsYxYpZbCrSp9G/4F13VUl8a BxaLUN7kNpWXys6757As4cFJadrFb8FNFfWRoip5kI9vTpDS8jklgj8qd+qaUTQosDSi git0LgE7CftocOCqF/+LdjuELhZeBvZFl6dGEIZy7+EmGZ1liqlhw7pNDIL8LPWdLPx3 zGcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=xToVRwKvsZGcrZ/opYHSbCFhW67g4BF1khn/EQq2G+Q=; fh=WbXBcbMo1pGnz6Y7uwcGt5F9jYCDCieR198Tn/ZWiJQ=; b=HmtsCAtePT2qHfHWTXj120NkR79tkR/Zjbrwf+YE/BspYWT+sxKqKVKhgWiv5oIWub if2qIovohxXBcF0CWf0j/H2w8SbQxL1c4ZCm6JabyMS44g6OS0lnmYOfdU4lfrORtSgj 0jYm+z9LK3iJS8yyrBjX4VDX25/Q4RhGH8shf7ZgLjBd7heGS315aE+EbgkbzcqecWyz WhNjZMVJGsaxIfLxdMjDrxWS6ZyZDhhUMoyGTElWeRdZycE77BTHDNnm1pn1rxkYxT1T sH4hClJ+FVjJ79olYVR8gcP166FjeaM8m3I/Bf0z1hrfT03V9MBAqLzkZWSp5a2oDRs4 pQqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-47580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCVyv4ufmqGWAJrXP+aDy7PdfordgHNVzqIYM+5GMhWmnNvq2txgOs/aCMCq+K1pKYmdhhlcbBO6j/1DF0Y7RcqFVURYDyjs4ZbQvKk0bQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z3-20020a633303000000b005d8bf42e02dsi8583075pgz.544.2024.01.31.19.32.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 19:32:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-47580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DD93328C5D8 for ; Thu, 1 Feb 2024 03:30:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 088613B194; Thu, 1 Feb 2024 03:30:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A23423A8C5; Thu, 1 Feb 2024 03:30:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706758241; cv=none; b=hcYvPoR8W/2uCg5nc9z9glehCFcB7hL9dfV91r7N/jk36t2iDqYBb9Aiw6311tHYJ1g7psv0EX6dbjSbINqhiNwxgNQhNX8ZUHkkT1dktNcN4gACkQxM0YYtlwmQs6hBpzRpZkDOJRTsEQkGv7DNzIPpOmuViUSmdRKwqQntFww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706758241; c=relaxed/simple; bh=0U0DRnxOD6IVrdCQPmo32znrfxpOuyUvuYMn1ho150w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AaU7UBeSPkm44jP2ZtQEVGGnbP0izIzyynUNf9/F/ulAMjwZtz2pXX5F2Z421wb4pV7gzH9KaGoqDUZswXuEXTNzjuyVQTeSVIPLW7fpdW7iuP7GDv0Ir8ARsg5p1rUq+j+c8b+zL1JuNpg3KYGrG+NZSkeqdZNeS45+jXdD44I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A4B63DA7; Wed, 31 Jan 2024 19:31:21 -0800 (PST) Received: from [10.162.42.11] (a077893.blr.arm.com [10.162.42.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DADF33F738; Wed, 31 Jan 2024 19:30:26 -0800 (PST) Message-ID: <08a4971e-c31d-46f7-afbc-7404bd9a293f@arm.com> Date: Thu, 1 Feb 2024 09:00:23 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v3 12/35] mm: Call arch_swap_prepare_to_restore() before arch_swap_restore() Content-Language: en-US To: Alexandru Elisei , catalin.marinas@arm.com, 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 Cc: pcc@google.com, steven.price@arm.com, vincenzo.frascino@arm.com, david@redhat.com, eugenis@google.com, kcc@google.com, hyesoo.yu@samsung.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, linux-trace-kernel@vger.kernel.org References: <20240125164256.4147-1-alexandru.elisei@arm.com> <20240125164256.4147-13-alexandru.elisei@arm.com> From: Anshuman Khandual In-Reply-To: <20240125164256.4147-13-alexandru.elisei@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/25/24 22:12, Alexandru Elisei wrote: > arm64 uses arch_swap_restore() to restore saved tags before the page is > swapped in and it's called in atomic context (with the ptl lock held). > > Introduce arch_swap_prepare_to_restore() that will allow an architecture to > perform extra work during swap in and outside of a critical section. > This will be used by arm64 to allocate a buffer in memory where to > temporarily save tags if tag storage is not available for the page being > swapped in. Just wondering if tag storage will always be unavailable for tagged pages being swapped in ? OR there are cases where allocation might not even be required ? This prepare phase needs to be outside the critical section - only because there might be memory allocations ?