From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 161B6C04A68 for ; Wed, 27 Jul 2022 10:59:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32AB7940013; Wed, 27 Jul 2022 06:59:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D8F3940012; Wed, 27 Jul 2022 06:59:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A20E940013; Wed, 27 Jul 2022 06:59:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 093CA940012 for ; Wed, 27 Jul 2022 06:59:42 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D88EE1C5B07 for ; Wed, 27 Jul 2022 10:59:41 +0000 (UTC) X-FDA: 79732584162.15.7032E42 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 730AA120029 for ; Wed, 27 Jul 2022 10:59:41 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6B7D4618BC; Wed, 27 Jul 2022 10:59:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46036C433B5; Wed, 27 Jul 2022 10:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658919579; bh=rt7aES8/Hzlk/Y+2Fqy8g4ajbN0y3PoWZvROhgiQ80Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=K2N/H6wkNiaX4mYYBDNVTGiXimHHrMudSzduFYV+r5tPZHn1Sow+uzDaT5lCDcyrX yrFVEdsusIks/GBsnYpUHtfe0yaLJnBecf0+7RFnqzO2bYHcR0XtlpmIoUBQVBWco+ hU119b/JJHrCOXGq0GEh/gw2RRrRcgwe88MVBGlXcc7rBXuabdbDA4uPTIygdKDq2V v2KR90Y84e0DaavIxxnVMhhcL35Q/eUQ2QOjvXf0cNgMIO8GGtigD6KFhi9AQ9Vejg xhonZJMveI9/jsjRfBKJKp6NfW14roNbmO7HxRCA6tpn9UhvZxejD2WuHwzVHbDYgp uRrbKrZhoCwZg== Message-ID: Date: Wed, 27 Jul 2022 12:59:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] mm/page_owner.c: allow page_owner with given start_pfn/count Content-Language: en-US To: Kassey Li , Matthew Wilcox Cc: akpm@linux-foundation.org, minchan@kernel.org, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, quic_guptap@quicinc.com References: <20220722150810.27740-1-quic_yingangl@quicinc.com> From: "Vlastimil Babka (SUSE)" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="K2N/H6wk"; spf=pass (imf29.hostedemail.com: domain of vbabka@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=vbabka@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658919581; a=rsa-sha256; cv=none; b=eSb1f/p5zfC1ZvdFt4kSX74uZmr2gW14/ETnkgk4o/+fxLKR6doJ0vwQ6MEk8q09//IU6S 9tKDv3YMcoMtREks1rh3yRm7LEd/hHGVmm+oYZG5+sxelGc18HZII60b+KEkXLh6wlo+Sn /XGmGfHaH9CZo/uU3BjLhfk9w5ykqKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658919581; h=from:from:sender: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:dkim-signature; bh=1Ju9T2fg58zlLXlbD5qyNE/JGi06stVKs0ant7rrHic=; b=AvTDBFuLgvcdDRSSRb4K5F0OT+vVU9C0f5vm6+GjlRC4ABVbCOd+BYoFKLzCYQq3dOt8Ou OcPgYeBtnAz6j57+x3Vai36RqpBtiKWG2bU9W2gTJLvTKNL/e35CITC1fryTmjfmhREHaC Ta6A2uF+vdKmQa2oXBHQkiI1XbjqIO8= X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 730AA120029 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="K2N/H6wk"; spf=pass (imf29.hostedemail.com: domain of vbabka@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=vbabka@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: f58cdqf366iinujnsbd8nmafygicjpti X-Rspam-User: X-HE-Tag: 1658919581-791002 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 7/27/22 09:44, Kassey Li wrote: > > > On 7/26/2022 10:03 PM, Vlastimil Babka (SUSE) wrote: >> On 7/25/22 10:39, Kassey Li wrote: >>> hi, Matthew: >>>      sorry for the delay, I just started to learn how to upstream patch, and >>> setup my Thunderbird with plain text only. >>>      you are right, two users will cause problem here. >>>      the uses case is dump CMA area to understand the page usage in a given >>> cma pool. 2nd, dump whole memory page owner is very time cost, mostly our >>> android device has 8G memory now. >>>      I will research and check again, if you have more idea on this , please >>> kindly to share. >> >> You could try employing lseek() to specify the start pfn, and as for end >> pfn, the process can just stop reading and close when it has seen enough? > > lseek is a good idea. > read_page_owner start with below >     pfn = min_low_pfn + *ppos; > so we need to export the min_low_pfn to user then decide the ppos to seek. > (my_cma.base_pfn - min_low_pfn) is the ppos we want to set. Hm could we just pfn = *ppos and then anything below min_low_pfn is skipped internally? So we don't need to teach userspace min_low_pfn. > is there concern to export min_low_pfn  ? > or use a mutex lock for my previous debugfs version patch ? > >> >>> BR >>> Kassey >>> >>> On 7/22/2022 11:38 PM, Matthew Wilcox wrote: >>>> On Fri, Jul 22, 2022 at 11:08:10PM +0800, Kassey Li wrote: >>>>> by default, page_owner iterates all page from min_low_pfn to >>>>> max_pfn, this cost too much time if we want an alternative pfn range. >>>>> >>>>> with this patch it allows user to set pfn range to dump the page_onwer. >>>> >>>> This is a really bad UI.  If two users try to do different ranges at the >>>> same time, it'll go wrong.  What use cases are you actually trying to >>>> solve? >>> >>