From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 C16E3200C4 for ; Thu, 9 Nov 2023 15:47:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="MP6ut27M" Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [IPv6:2001:41d0:203:375::aa]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F038A358C for ; Thu, 9 Nov 2023 07:47:51 -0800 (PST) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1699544870; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K7iD0mry1TaOJ3BfGGYjkfYRYXQnVJFxaQEa8O7iA/A=; b=MP6ut27M891zQeBM8vCKXc9NomQMYkQGjceA99reGEoFrHsUxJ3YqumbnGY6qeDNZrkWAL xkFz7VRWmYTLEAkdwM7kg5O8W5njy0ONzc+1zJbKL53sJ5P9chzbdxEnyEAlQH9ksMmgc2 e853j8MfB+P+IiWTDl91iUzST8FPcmw= Date: Thu, 09 Nov 2023 15:47:48 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: jeff.xie@linux.dev Message-ID: TLS-Required: No Subject: Re: [RFC][PATCH 4/4] mm/rmap: implement anonmap allocate post callback for page_owner To: "Matthew Wilcox" Cc: akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, vbabka@suse.cz, cl@linux.com, penberg@kernel.org, rientjes@google.com, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, chensong_2000@189.cn, xiehuan09@gmail.com In-Reply-To: References: <20231109032521.392217-1-jeff.xie@linux.dev> <20231109032521.392217-5-jeff.xie@linux.dev> X-Migadu-Flow: FLOW_OUT November 9, 2023 at 10:10 PM, "Matthew Wilcox" wrot= e: >=20 >=20On Thu, Nov 09, 2023 at 11:25:21AM +0800, Jeff Xie wrote: >=20 >=20>=20 >=20> +static int anon_alloc_post_page_owner(struct folio *folio, struct = task_struct *tsk, > > + void *data, char *kbuf, size_t count) > > +{ > > + int ret; > > + unsigned long address =3D (unsigned long)data; > > + > > + ret =3D scnprintf(kbuf, count, "ANON_PAGE address 0x%lx\n", addres= s); > >=20 >=20 > ... completely ignoring that it might have been mremap() since ... >=20 >=20I'm not an expert on anon memory. I'm sure someone can tell you how t= o > figure out the current address that a folio is mapped at. > I'm currently not sure if the address parameter is the mapped address, so= this is an RFC patchset ;-) __ Jeff Xie