Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2445129iob; Fri, 20 May 2022 09:28:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOkYVByCAfaXSCnVoX61CM3tp6IV8maANsw2krPYPRh0KBvgdXeSpOYDCqTKFIeMXXHYkk X-Received: by 2002:a17:907:7f25:b0:6f4:c553:c73c with SMTP id qf37-20020a1709077f2500b006f4c553c73cmr9310037ejc.119.1653064122523; Fri, 20 May 2022 09:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653064122; cv=none; d=google.com; s=arc-20160816; b=HTs8ocMEdfh3DR/vBD9imaj3gsjJZabQTcCt0gKthjPTFK/H9MlrFENktoORSZh8u7 42uetaJX5HXTbDALWv5fnLVZ+p9ozIZ7n1SYjX4+l1hJRIyImkBG4FDBjyO8lznYepoT VWC/RE5j1FY5HLZwtmOF51VLMwPFjOY0I9mGumwnC24n0gfBq/8LXi5Rk22FJe0cUZJN jkfPG4hiBQAy4N/PdIvXG2wFFqqR6Xz7bqpUBC+w3oMBF5+jkrP5D7h6YExL09EdCoue oCk82m3ovptDuY4Fg/DA8BFV3v2I4DBwKAjkHWN7BLpC9ZnbnFAZE/mHitNAQhWuvWSO ZuOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=JJh4foNOJwG8ay+rF9OREYoAAGUcy1t9u8UYkcLppDI=; b=p+ixRJy4jFqMuNNftvZP7048EjFfcseZrx56qBNPNEAZFotp8FzNIAktWTvQjwLjej 3kIqYFOvKZWy/4MsTyV0pINGBP/wFVXIoBa9g+t9Gsr5aV6zeXDOTE2yj8tifB0kJJsY bL7TOMf627xeZuJnCB8792DsGbuhIfAR+hNgZM9wiVtqZtO53DCm8nNEM+ZBhL9NCGiM F8TvKEDoO8B58Jw+8demD4PPzcoRUaffpNLPS4WaHD5LuBqU3LZw+qyNyNmfGb7i2XvN 3AxvvP5pm68Tn1Xr+Im0y82cTFiT+YrjJxNdYFn3KwBQ4Zw1YcmcddLHFzA1MPaKB1MZ gjdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ELKkv1yz; 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=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a1709064fc800b006e81dd29c00si9634309ejw.569.2022.05.20.09.28.15; Fri, 20 May 2022 09:28:42 -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=@ibm.com header.s=pp1 header.b=ELKkv1yz; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345483AbiETFQL (ORCPT + 99 others); Fri, 20 May 2022 01:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343793AbiETFQI (ORCPT ); Fri, 20 May 2022 01:16:08 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C3D61CFE3; Thu, 19 May 2022 22:16:06 -0700 (PDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24K3219w022525; Fri, 20 May 2022 05:15:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type; s=pp1; bh=JJh4foNOJwG8ay+rF9OREYoAAGUcy1t9u8UYkcLppDI=; b=ELKkv1yz+L8SWhSgdtOrbEXtZvOD+cENx24BoptdFKJngLJFqAFk4gTXTNJ6tG6EB0yF JiGrfsBf6gJRSVo7Sb1bkQ6AA1pAL/oR4vJgpke7pfbmhCC/IKyTRKSr4Q4nMWe/kgav AIkMzmFjMhAr3rpEbF+raurSOIPtWvkV5AvXlTlmSrLKtmWPUDLhr87OYLEou6LuhXqq A5ltkwBf131kfTnPReceOVT54PMoIJCJQejCoP6dewY4M8lJ8otOYiRATJaw/68W5uz+ RUDj2K+tBQMdhkp8xdt8a93uCsBYzSc48p+lnt+bei2JmuVKNjFB8+u5c0Q3PngIdWYK ng== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g62qn9x50-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 May 2022 05:15:55 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24K51Q2l030637; Fri, 20 May 2022 05:15:54 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g62qn9x4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 May 2022 05:15:54 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24K5DW8S032186; Fri, 20 May 2022 05:15:52 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma05fra.de.ibm.com with ESMTP id 3g4j3gjx92-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 May 2022 05:15:51 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24K51rQg27197884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 May 2022 05:01:53 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 91DC342042; Fri, 20 May 2022 05:15:49 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B5734203F; Fri, 20 May 2022 05:15:45 +0000 (GMT) Received: from vajain21.in.ibm.com (unknown [9.43.28.38]) by d06av24.portsmouth.uk.ibm.com (Postfix) with SMTP; Fri, 20 May 2022 05:15:44 +0000 (GMT) Received: by vajain21.in.ibm.com (sSMTP sendmail emulation); Fri, 20 May 2022 10:45:43 +0530 From: Vaibhav Jain To: Michal Hocko Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Vladimir Davydov , Andrew Morton , "Aneesh Kumar K . V" , Shakeel Butt , Yosry Ahmed Subject: Re: [PATCH] memcg: provide reclaim stats via 'memory.reclaim' In-Reply-To: References: <20220518223815.809858-1-vaibhav@linux.ibm.com> Date: Fri, 20 May 2022 10:45:43 +0530 Message-ID: <87zgjcg4xs.fsf@vajain21.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 5T_FrutWWajenUiwrEh1WQrKQwHVVumD X-Proofpoint-GUID: Tqq3v_2AuLsqGIjRi0bMvCf5ZZ4XM941 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-20_01,2022-05-19_03,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 clxscore=1011 impostorscore=0 mlxscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxlogscore=691 phishscore=0 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205200036 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Thanks for looking into this patch Michal, Michal Hocko writes: > On Thu 19-05-22 04:08:15, Vaibhav Jain wrote: >> [1] Provides a way for user-space to trigger proactive reclaim by introducing >> a write-only memcg file 'memory.reclaim'. However reclaim stats like number >> of pages scanned and reclaimed is still not directly available to the >> user-space. >> >> This patch proposes to extend [1] to make the memcg file 'memory.reclaim' >> readable which returns the number of pages scanned / reclaimed during the >> reclaim process from 'struct vmpressure' associated with each memcg. This should >> let user-space asses how successful proactive reclaim triggered from memcg >> 'memory.reclaim' was ? >> >> With the patch following command flow is expected: >> >> # echo "1M" > memory.reclaim >> >> # cat memory.reclaim >> scanned 76 >> reclaimed 32 > > Why cannot you use memory.stat? Sure it would require to iterate over > the reclaimed hierarchy but the information about scanned and reclaimed > pages as well as other potentially useful stats is there. Agree that "memory.stat" is more suitable for scanned/reclaimed stats as it already is exposing bunch of other stats. The discussion on this patch however seems to have split into two parts: 1. Is it a good idea to expose nr_scanned/nr_reclaimed to users-space and if yes how ? IMHO, I think it will be better to expose this info via 'memory.stat' as it can be useful insight into the reclaim efficiency and vmpressure. 2. Will it be useful to provide feedback to userspace when it writes to 'memory.reclaim' on how much memory has been reclaimed ? IMHO, this will be a useful feeback to userspace to better adjust future proactive reclaim requests via 'memory.reclaim' -- > Michal Hocko > SUSE Labs > -- Cheers ~ Vaibhav