Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp289248imn; Wed, 27 Jul 2022 06:23:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1syFhlMgU2vdOOkjb8ePT5h9HOzwmMYX4pZIvU54QYTKkmUybwG33VsZ7aZZqFYlr5x/X8W X-Received: by 2002:a17:907:2724:b0:72b:526f:6389 with SMTP id d4-20020a170907272400b0072b526f6389mr4629867ejl.289.1658928236574; Wed, 27 Jul 2022 06:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658928236; cv=none; d=google.com; s=arc-20160816; b=CtmWXy/NPKSOk3xArXYruOUO4e0I+IQ4I4LS7Eyq5NHziN8dfTZAHO1vAPiewWoK1F sPTFyJe/NQoCnLp5kLXJuMZDq64nqBA+f/06t8VP+kIpb6dSCXY1wH0U5qOsS/2MwkPw 9ICtgFeSTJm0/aMHoA8/DaGbm00No7o4JVc4109S7h2LFA0nZT6Hnavt/ogsIwa74xjM mkgPJ4t2mmKpZHP7S0eH97tu4+a5oXlqoXDZ3KnfwK4eflV+h/U/W1GLDV7NAYQgext7 RtkUn8P37DfSrdwoq12X2ryOgWVTYnsHi2d6kiFn3ZBBvXlTY7+HWb1dtHFAx8wCLmBJ zSrQ== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=r+Snd/dR150rn/ALudIia+roqPZYxvTlnF6J8rxm1O4=; b=bU78H9ZwQ/JGIx8tLlOhUgDq12kRmd4C7vZu3trxfK/kALC3/3GxqChqC5TN4gLsx3 jZE8jFbTik8nvbgueDkyOio0uGZM2emK/UjsAauW3rmkRwWlbgy6/AUA5oXERy5Q/bhU xdreAR9TAxoH1I5pR3CojLrUfe0yAIZ9ubheMqFuMo59ARfD8Z7R0QUunpEIfQvrOQP0 4GqryUkfNI2wdNH51ddL4ADkiWNkY9UrVNryEIOihuuSA2FHfT3t0JzHYEMGr/OJg1bo fhqwLaEMFNrp3ae/6ZvKg2bBFUOsFEY0LgoFfMyychBMaWOcTRyqsstj5ocxw4DI8pBC YzJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vJfCAtrG; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf36-20020a1709077f2400b0072b0f4f4b36si20080600ejc.611.2022.07.27.06.23.30; Wed, 27 Jul 2022 06:23:56 -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=@quicinc.com header.s=qcdkim header.b=vJfCAtrG; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232524AbiG0M6o (ORCPT + 99 others); Wed, 27 Jul 2022 08:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbiG0M6m (ORCPT ); Wed, 27 Jul 2022 08:58:42 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3472BB2F for ; Wed, 27 Jul 2022 05:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1658926721; x=1690462721; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=r+Snd/dR150rn/ALudIia+roqPZYxvTlnF6J8rxm1O4=; b=vJfCAtrGwxcBlRWS1q5ZUVW3AsFleIkJa0UHMxPbLDgByodLruCG6B1z tI0QYVCJlw1Hae+1q6uwLmfbiUdSTXMuudi0y+0SLHn0p7L8xa1sVHvE5 12baUf8gY2v2ivWfkjo5v1Y2GsOftSCWI1ho3gy4/ZSGFpeAHLs2g9+i0 Y=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.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) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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/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? >>>> >>> >