Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp212819imn; Wed, 27 Jul 2022 04:21:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tyGoSF7flTAlvlfweUopBTxPmG2RbCxwl2GjWazxJdYJWk1U1aDpFRO3DVUGs3UlUi5LUU X-Received: by 2002:a17:907:7ea1:b0:72b:83cf:4ce9 with SMTP id qb33-20020a1709077ea100b0072b83cf4ce9mr17188503ejc.204.1658920878394; Wed, 27 Jul 2022 04:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658920878; cv=none; d=google.com; s=arc-20160816; b=FSlYlT53lYY7zS/dl0EGfsgZOkhpc26M7IXlcJHWfLfEDPh+FrU7skg/43hgADmwot lhaSWIRGYAeTf0wFyamM41aHyy0KgIr4rXySis2Op26z5pp50kdWQglm7hY8gJhFlsFJ o/2lzdZP9st5T7ojGBfXTkh1ZM85WGvwWU6H8hkNVAPmgmAI+nrUnPq2OkNO0nKL7pQ7 8AEooPCkE0KZYUKWCtJJPRbhI7V1GCcDwJIaNu6RbL0FPXID6NBkVCcMSFFo5TJwTmuE pNOq7iBl78Yj+NWJKRKPcUZ+72ZIXgjjTaXSxvQ8SBQySneGE9r7iuRJ/CVuA+BqCUK0 vGRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1Ju9T2fg58zlLXlbD5qyNE/JGi06stVKs0ant7rrHic=; b=Q4rFMYOQ/23QcvaTTPqwWSabK/+9BNrqSN8nuOn4QZ2e8wxQ/dztZZsU7zkkwxtAj1 d4n7dEgHc8cXXKOhA7C9ZpQd6bi0xFN88TZ+lSgm2PpQ8ULssLP6rKFwG/GvNm0oJPl+ FOpZEoxT4dEuL618VLvVhKMP4reb5kRYBty2euvvUpMwopWiR+k2U9/Ue0ULyUIJ4xug bEU7/E6L1zJ1GprMaUh3Fz0yZf/3/PGVc9bCq31kC7liZrhebfGoR/30JnuvYkQEH2Io T+qmsL49jFksaVFV+w3GhyNUEvIIMTbh4ZXrYfbqPePUwRj9EqEI28KCQ1/8p8Uf7cuZ 35wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K2N/H6wk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a056402518e00b0043ac5ba36easi20203566edd.419.2022.07.27.04.20.53; Wed, 27 Jul 2022 04:21:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K2N/H6wk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbiG0K7y (ORCPT + 99 others); Wed, 27 Jul 2022 06:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232119AbiG0K7s (ORCPT ); Wed, 27 Jul 2022 06:59:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75695491F0 for ; Wed, 27 Jul 2022 03:59:42 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 13015B82016 for ; Wed, 27 Jul 2022 10:59:41 +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 X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? >>> >>