Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp877627lqs; Fri, 14 Jun 2024 08:09:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmTM4eFVfy9XlhwzBPsMz8tiA7WzwKJsF5S5KIw1LJ5PC9aZ59FIdrrHFiGIMHXMVuBMFjRlKaQ+F4XEi4phLOojV3EwvRZp1ruC0qhQ== X-Google-Smtp-Source: AGHT+IFml+2wNPYr30/mtieHpATNtS1H71m8NboZTbxEe5tVaRDenSt97oKI76Xk2mpzuXKUFz6O X-Received: by 2002:a9d:6359:0:b0:6fb:8193:85f3 with SMTP id 46e09a7af769-6fb93b035f7mr2952468a34.29.1718377788928; Fri, 14 Jun 2024 08:09:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718377788; cv=pass; d=google.com; s=arc-20160816; b=qeqoF9Uk4CsWIGF+0ZwkWQM2qBGt6MRhDwo0bh4ZuhoqSdP5glvZ+l2jUCtQDZbMp+ EU/NadmZFaj4aq/4MBRNM/PSVTGdjvyzCtiv2Bb3qekfhg9aRKordvxg0e96iqA1Ufcq 2qelDdWObp8zh7C4eauG0zZ2i4qB/LGzxk+ZZUBhXqRWbw1XFD/Og7pCfPG1gQsisIqD y7OHeTn80g+2W7+QUozM46voykgZruz/kpLym0ut30tugPfbvGTJPDYWXaSOdeFyF4v/ hiW+xQN0D/NKEmVgg8isPVH0waODZkv2JTeHIN946q6yzj2MKMdGlP/foUFgONsQU0u4 8YKA== 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; bh=MkGNSxl+h9z5YLWRwO1nvyFUAAj208IaWD4lkOkSdJo=; fh=D1FdRpKXOlzxkksie+M59v134pYP76bQLAhLwyGvRTg=; b=eyJ+GIt6Yqu2XrpmE9hD3hwbcdqHnnIZL9Q9+m+Cj4KJkb1Jj+EzfnE/SfJAFPYJKc pYnqc30amNhkYshXApZBpUbaezE2ZcCOXdr5H9hOd7svptj2iMWIwYzttN74sQAQkqKu ZX+DISQgQrMzHqNrUHWKob69s/5PC4+ExfUb3gVn63h3cFVQq+/E7lQ5hod8aM503a97 6KIFCd9yLaEANRz0r2rIo3ct6uuw9HcVWjmlLNvmCrmrLGhJUanmm9gu+ZEnWDJ47e5I 4tUzafXy4KzKJVxBIjZGllFp09YYVsf3Td/JrGHD2sj/sdaFXdt3b8JJWr9W20+WCEOB vO4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=vgW65Jd8; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-215107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-798c584b3dcsi318398985a.549.2024.06.14.08.09.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=vgW65Jd8; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-215107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9C96B1C20EC8 for ; Fri, 14 Jun 2024 15:09:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D28851922ED; Fri, 14 Jun 2024 15:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="vgW65Jd8" Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4431181D1F for ; Fri, 14 Jun 2024 15:03:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377400; cv=none; b=jOAmbMwwaffWZAZmW7NWbVQai85WdimIJYDRU7MDWHR9gV/KGGPyyU7qmN5fdAi822ytj9WzpvxcvwwL9AfpDh1NfukdRyMeuGAEM6vzQ58ygS1Z6oKb0IcEQ7yhFoEiFHvjyZL0JT+AkcEQy/00mGOzdGNAWLZdDEu30xD1NQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377400; c=relaxed/simple; bh=tbqO0nM73sxGeOhzCDR3cQjJBLpEqVEwNgHhiBQrnOk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J6GOtvWCOLkxRyKTqxCL5tY055v8m7x9oLDbyAaCekcuYDpeYDxHVSK9pjl8FrGpFIkfWGxTqsiaKUU+NaejTIDK5YULG+AKmhjbXLhH1bnl0P7ljeg5BvbzVpvW6gE6ii+zbc2rTk5vOuFa5K6WNlGRySkS5ccJBdnND1+oq0k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=vgW65Jd8; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: baolin.wang@linux.alibaba.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718377395; h=from:from:reply-to:subject:subject: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=MkGNSxl+h9z5YLWRwO1nvyFUAAj208IaWD4lkOkSdJo=; b=vgW65Jd8yLdKDIVGxsjhfPgWlr30uaqU08jhcoEaAe56TzhobuoV8WAsiGt/N5HG2xLY3m rHe8wDF4dgaRE7t4+LWnFR0jNEeJPPOc0HMu3mJHPLVxbUJGEw/3GGQHaMZ+ztBp1EI/n2 skOVz1ufzzPLMezwvXDQeIrr2wwBoLw= X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: mhocko@kernel.org X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: muchun.song@linux.dev X-Envelope-To: hannes@cmpxchg.org X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org Date: Fri, 14 Jun 2024 08:03:09 -0700 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Baolin Wang Cc: akpm@linux-foundation.org, mhocko@kernel.org, roman.gushchin@linux.dev, muchun.song@linux.dev, hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: memcontrol: add VM_BUG_ON_FOLIO() to catch lru folio in mem_cgroup_migrate() Message-ID: References: <66d181c41b7ced35dbd39ffd3f5774a11aef266a.1718327124.git.baolin.wang@linux.alibaba.com> 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: <66d181c41b7ced35dbd39ffd3f5774a11aef266a.1718327124.git.baolin.wang@linux.alibaba.com> X-Migadu-Flow: FLOW_OUT On Fri, Jun 14, 2024 at 09:07:42AM GMT, Baolin Wang wrote: > The mem_cgroup_migrate() will clear the memcg data of the old folio, > therefore, the callers must make sure the old folio is no longer on > the LRU list, otherwise the old folio can not get the correct lruvec > object without the memcg data, which could lead to potential problems [1]. > > Thus adding a VM_BUG_ON_FOLIO() to catch this issue. > > [1] https://lore.kernel.org/all/5ab860d8ee987955e917748f9d6da525d3b52690.1718326003.git.baolin.wang@linux.alibaba.com/ > Suggested-by: Shakeel Butt > Signed-off-by: Baolin Wang Acked-by: Shakeel Butt