Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2001340lqz; Tue, 2 Apr 2024 04:34:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFD0dzIyrOBsuBSLwnteROoq8J+gzElCur56blS8j3MXK/ca3VaIfetnw48objIUh1oCxjjgr4hIHbYTCE4OVYAEM2lX9Z62KizesFuQ== X-Google-Smtp-Source: AGHT+IER4tse92MkleHCdlPYG+U73j+97az2BgwHz3Owv89NjDbNJFABMEAz1s4Q7YhGzcDGrram X-Received: by 2002:a05:6a20:439f:b0:1a5:72dc:2fe0 with SMTP id i31-20020a056a20439f00b001a572dc2fe0mr13174747pzl.14.1712057660546; Tue, 02 Apr 2024 04:34:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712057660; cv=pass; d=google.com; s=arc-20160816; b=ae3BDkfNWsorLSI9YmxBVLJyAwcfhfIG27QPukUP8CtqpufVaSROR25aTj/DtdX1Yb E/XQ3WqnhY4YMrIQ2EhOMAN9/XW+anctL1+TGR2hF8KK39UaoRDyt6sBBpQ85oJt3UV+ 0LldcUYS5D36oqCIdv7yfziN+AHyjL8NdLubpVPC/tmQ0hifKmDO1f+YugiZqh/rNI/q xcZXG0lwL9wKI1HzwordSY0FY0SO3GDmiL99PSBT1EnoivfOR31DgpQPIvzin+paLviD W9Xy/HycGfideMwg0TuyFBMrL030cWsCKjd1oul2Sm5pcLSYi1NIRgyueTzlGaQ3U8vq QC5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=aAq/U+6X2FU1Ny7L5MaCtJaxVAMjEFjjhoVMNVa1LRA=; fh=un/7AXazoEIibWjEhGIYzoVpGud9WBpRFG5JjZGiHEA=; b=CkEeqWaVhYzJQk5ZfbN6UsvZVNmQOlLj40TVoULkdNpKGp3AjeRODw8m4n7FiFTDci sOk4T9YMDTl/F6BETMMd3TWSGvutQ3o/Y7Dh4bkWNXVIvX28EjsesoGiz+7HGvc3OPjT G5V40NoFPczTPEIXz7EqELQPfYrwV5zuDLTG5/HyONpi3Az28wN36cWaDZOoQuRPypCu AP/UvvvvsrdM1AN7oJAyQ7wfJl6+Xqm6prcRZrEeAxJcqiiu0TidyNuFumWLpMIwzmOe TAu2O63oFZVefxmMaRolOAScCPjxpuOqt7+sFs9PxE5pbkDGOweRfBpRa/8nsKcS9jAd nU0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OpjzEZSI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-127846-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127846-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d13-20020a17090b004d00b002a240673ba5si3723674pjt.166.2024.04.02.04.34.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 04:34:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127846-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OpjzEZSI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-127846-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127846-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 76A44B24970 for ; Tue, 2 Apr 2024 11:18:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5694061691; Tue, 2 Apr 2024 11:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OpjzEZSI"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="sqEKNPI3" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FA02657D3 for ; Tue, 2 Apr 2024 11:18:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712056702; cv=none; b=q1Z+tQ6q3n88oP3SM1GICysCJmIFvcKVspI3hMWEFhvaRmEWGAqG3TC5OBTauIcASLBgvSCoDEC+VzhROFfWnorYHPE2E9+0isloXmE5Y5YKUI8nR1m3yLERZVz8H64/1vbDcaFaDk596jb5GHoa7dkyejxrokWsYUzKB1SYUuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712056702; c=relaxed/simple; bh=ICD4Y8wvqTNQH/0MD5Y90RNOMbA2NIYL56fFbjuysDE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eBZT+luSat+7Cp8snm6/LEKrjRVZFgN+DQ+/Q4pJ84ZoKByC3g7hMLYh1dQeqdBTZUJv/L2ttBLWhgTPfw7xnOLhtKfwoqPv26EP+JU3qjsaVApFYP4LKUxyVOXIPXCiAh513eY6r8We7s06LKvQ955FVjpqRXloiap9OJA6bBY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OpjzEZSI; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=sqEKNPI3; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7E6C1345F5; Tue, 2 Apr 2024 11:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712056697; h=from:from:reply-to: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=aAq/U+6X2FU1Ny7L5MaCtJaxVAMjEFjjhoVMNVa1LRA=; b=OpjzEZSIeaV/xVL5HxPYCzZcziyAGhwFUlrXAJCEiamSkZp7kMngXd7IvTFJs86ubo9BwB 4/hv/kIjmcj52eCfkL8Id5Fq3NMe+Nx10EtkEpFwLBMVK9HAoBnoKWEyR2Byu3o7NF+xyP PcuH5bySzf/55VT4EwUNme6qF88H4e8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712056697; h=from:from:reply-to: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=aAq/U+6X2FU1Ny7L5MaCtJaxVAMjEFjjhoVMNVa1LRA=; b=sqEKNPI3qoHg/qxrpvEH7msdmJiNVLL2N05M4q6ZjouWy9JNY8LvXoQg5JLPeCRXk/ngnv aaoFRSl5Vn64DUCg== Authentication-Results: smtp-out1.suse.de; dkim=none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 0875813357; Tue, 2 Apr 2024 11:18:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id CgP9OnjpC2YJJwAAn2gu4w (envelope-from ); Tue, 02 Apr 2024 11:18:16 +0000 Date: Tue, 2 Apr 2024 13:19:42 +0200 From: Oscar Salvador To: Vlastimil Babka Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Marco Elver , Andrey Konovalov , Alexander Potapenko Subject: Re: [PATCH v3 1/3] mm,page_owner: Update metada for tail pages Message-ID: References: <20240326063036.6242-1-osalvador@suse.de> <20240326063036.6242-2-osalvador@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 7E6C1345F5 X-Spamd-Result: default: False [-3.31 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_SHORT(-0.20)[-0.995]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[linux-foundation.org,vger.kernel.org,kvack.org,suse.com,google.com,gmail.com]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spam-Score: -3.31 X-Spam-Level: X-Spam-Flag: NO On Tue, Apr 02, 2024 at 12:13:37PM +0200, Vlastimil Babka wrote: > Subject: metada -> metadata Ooops. > > Signed-off-by: Oscar Salvador > > Reviewed-by: Vlastimil Babka Thanks! > > @@ -355,31 +375,21 @@ void __folio_copy_owner(struct folio *newfolio, struct folio *old) > > - * We don't clear the bit on the old folio as it's going to be freed > > - * after migration. Until then, the info can be useful in case of > > - * a bug, and the overall stats will be off a bit only temporarily. > > - * Also, migrate_misplaced_transhuge_page() can still fail the > > - * migration and then we want the old folio to retain the info. But > > - * in that case we also don't need to explicitly clear the info from > > - * the new page, which will be freed. > > + * Do not proactively clear PAGE_EXT_OWNER{_ALLOCATED} bits as the folio > > + * will be freed after migration. Keep them until then as they may be > > + * useful. > > */ > > The full old comment made sense, the new one sounds like it's talking about > the old folio ("will be freed after migration") but we're modifying the new > folio here. IIUC it means the case of migration failing and then the new > folio MIGHT be freed. So I think you made the comment too much concise to be > immediately clear? It probably could be improved by saying that there is no need to clear the bit from the old folio since that will be done when __reset_page_owner() gets called on the old folio. Now, answering your question about whether we can fail or not at this stage. I looked into this a few weeks ago and I made my mind that no, we cannot fail at this stage, and the following is my reasoning. This is the callchain that leads to folio_copy_owner: migrate_folio_move move_to_new_folio migrate_folio migrate_folio_extra folio_migrate_copy folio_copy folio_migrate_flags folio_copy_owner folio_copy_owner() gets called only from folio_migrate_flags(). And all the functions that call folio_migrate_flags(), return MIGRATEPAGE_SUCCESS right after calling it, so it is kinda the last step of the migration. So no, we cannot fail at this stage, so we do not have to worry about undoing this. -- Oscar Salvador SUSE Labs