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 2089CC04A68 for ; Wed, 27 Jul 2022 12:58:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C04A940017; Wed, 27 Jul 2022 08:58:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96F0B940012; Wed, 27 Jul 2022 08:58:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80FBA940017; Wed, 27 Jul 2022 08:58:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6EAA7940012 for ; Wed, 27 Jul 2022 08:58:43 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 42CFE1C5BC6 for ; Wed, 27 Jul 2022 12:58:43 +0000 (UTC) X-FDA: 79732884126.22.DDF6227 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by imf24.hostedemail.com (Postfix) with ESMTP id AA86B1800BE for ; Wed, 27 Jul 2022 12:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1658926722; x=1690462722; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=r+Snd/dR150rn/ALudIia+roqPZYxvTlnF6J8rxm1O4=; b=xYA7Cd5LiUW5lVFiCXJ8lFxqVTpHvz/Pgf9GpgCFZsCGZMaxkbFifpNo bHynPgH7sUgMKHlEWuQjQXdbkQqYd015VjwdeVv1DVaxKepPY2IE8uCfj 1/o8qz5ltvP3CZ7Bi5vs6uuFV5lnxeEMaMvkNKgqVLW0WE63Qu5Zr+ns3 4=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 27 Jul 2022 05:58:41 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2022 05:58:41 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 27 Jul 2022 05:58:40 -0700 Received: from [10.232.65.248] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 27 Jul 2022 05:58:37 -0700 Message-ID: Date: Wed, 27 Jul 2022 20:58:35 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH] mm/page_owner.c: allow page_owner with given start_pfn/count To: "Vlastimil Babka (SUSE)" , Matthew Wilcox CC: , , , , , , References: <20220722150810.27740-1-quic_yingangl@quicinc.com> Content-Language: en-US From: Kassey Li In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=xYA7Cd5L; spf=pass (imf24.hostedemail.com: domain of quic_yingangl@quicinc.com designates 199.106.114.38 as permitted sender) smtp.mailfrom=quic_yingangl@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658926723; a=rsa-sha256; cv=none; b=u7IXrZjafhkIxhf2SHCc+bG9yRLfI//PBDMwaQZu2Tdh6Ny1HNI+lIVQiwsqQH6j9e6me5 kvQTeeP61riH2BNZ+3BJusaUWZBk0TcFI+zoD3F2g0d3CO5IzBlnLazFa9jnR03TCtpAwc r9oXf3E41grxOLJae7rC9DxxwZ0/OCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658926723; 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=r+Snd/dR150rn/ALudIia+roqPZYxvTlnF6J8rxm1O4=; b=hs44dTwvl7a/kmbBK05PqQ7xrnv0nuRtvdI5AKfQJG4HsiNr5QXdHxQ+frAXwj3nCVsWsd 010az6bmnTQxwvXlh858JIn/crOOWc8gc4GxSic5RY1k5OxTZAVv48AJiPO9vz64cGe21o 8Omgp8zQGkEZGDafC2xCkI2qu4RlUaE= Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=xYA7Cd5L; spf=pass (imf24.hostedemail.com: domain of quic_yingangl@quicinc.com designates 199.106.114.38 as permitted sender) smtp.mailfrom=quic_yingangl@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: AA86B1800BE X-Stat-Signature: igju5zpdwaurnt9b5rj6fu6cz63qwm9b X-HE-Tag: 1658926722-328839 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/2022 6:59 PM, Vlastimil Babka (SUSE) wrote: > 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. that makes sense. I send out a new path "mm/page_owner.c: add llseek for page_owner" according your suggest, please help to review again, thanks. > >> 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? >>>> >>> >