Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1143415pxb; Thu, 15 Apr 2021 15:27:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxdt1OspG7+YDFRUsWXchRfUd0PfbxoR88lOXRR8so+55dsWhyINtL6HcA/P2szNlBO4gc X-Received: by 2002:a17:90a:b794:: with SMTP id m20mr6124305pjr.152.1618525630432; Thu, 15 Apr 2021 15:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618525630; cv=none; d=google.com; s=arc-20160816; b=hojxPrK43r1wOMDJ06G7Et4AGwVV4Z54lsvOssNGV862KGiCLOOXxcmlWwtG9C2UMG OsEpwhFwPOtLNN3b6brweAqzjvr4WUIOuaYzvPGVGsQb7OtCqtMvY2nZwgRbH5ScGlNF 6ooOWImyiDF8I6X9RHNMeoPPTcr7A5f6TScORgpRwmijQzBfoTHmqYdLAEhgQm0Q4YZR itnUrXbtvbZqmiHSmcrV2qRswfCnkgxm6cxmGOvbJKEg/VpH7cAD9pjJNxxU8Qf2KNhb RFGtvIG4nLCz3d4lPRESqiizDzdYPu1AWr7uYEM4WuLHqBiFIhmWv86srRqe4hpmABBE L8Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=AwVxyBEn08z3yoM+hGYVqC3wlmszivLfDRQa5x7qquY=; b=d6QmgeQaAa2wIWsUOGjAyd2DuXJiB/rW0aOESJioKTi3f1PJNXLkd0STFlDxxTTRkb ONQyZ76L55/+7D/wN4K3wH963Accj1JtVMWVYONYbNCIeyhpx2YpcEDfCWzar6rB9tqK Xc+pUzHIVy/v3LShGQ+NvvCnH5yNJy9QITjMP62NWXgH/AA56EcYexivKprK6RvJRegO YmgcCXVjQqZA9bqkcjl8yyVgqm9UECD0WjTvBlu6wjaC5T4Cfvyw4lxq26yf+fE9SV8h S9x3NZwjv2FFP1XyQ1pHJ6tm4hJcRblsGAYoUMwpghnpdDeCjtprvk81wxpZDlb7sJ6j OPLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si4371612pgv.538.2021.04.15.15.26.57; Thu, 15 Apr 2021 15:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235926AbhDOWZb (ORCPT + 99 others); Thu, 15 Apr 2021 18:25:31 -0400 Received: from mga17.intel.com ([192.55.52.151]:38286 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235142AbhDOWZa (ORCPT ); Thu, 15 Apr 2021 18:25:30 -0400 IronPort-SDR: stbwseUmZ4/Y/Rb+MscS0VZi2sOafrBtEwl6UBHa11kWbEXx/azMdw7Nr9DXLJq6VNMIFNX5lJ UBGjqqnGUH6A== X-IronPort-AV: E=McAfee;i="6200,9189,9955"; a="175061684" X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="175061684" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 15:25:07 -0700 IronPort-SDR: xUieIgZ5t9XqViXlT/Xiz8pE85lVfU5M29qtbi/LwOuEFY8A6k6mTTSyHnf3AVjmABlszgpu6u MWFfbNN9jPMA== X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="453106552" Received: from schen9-mobl.amr.corp.intel.com ([10.209.21.67]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 15:25:06 -0700 Subject: Re: [RFC PATCH v1 00/11] Manage the top tier memory in a tiered memory To: Shakeel Butt Cc: Michal Hocko , Johannes Weiner , Andrew Morton , Dave Hansen , Ying Huang , Dan Williams , David Rientjes , Linux MM , Cgroups , LKML References: From: Tim Chen Message-ID: <86a6f2e1-8aed-00fc-fbd7-9250277b201f@linux.intel.com> Date: Thu, 15 Apr 2021 15:25:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/8/21 10:18 AM, Shakeel Butt wrote: > > Using v1's soft limit like behavior can potentially cause high > priority jobs to stall to make enough space on top tier memory on > their allocation path and I think this patchset is aiming to reduce > that impact by making kswapd do that work. However I think the more > concerning issue is the low priority job hogging the top tier memory. > > The possible ways the low priority job can hog the top tier memory are > by allocating non-movable memory or by mlocking the memory. (Oh there > is also pinning the memory but I don't know if there is a user api to > pin memory?) For the mlocked memory, you need to either modify the > reclaim code or use a different mechanism for demoting cold memory. > > Basically I am saying we should put the upfront control (limit) on the > usage of top tier memory by the jobs. > Circling back to your comment here. I agree that soft limit is deficient in this scenario that you have pointed out. Eventually I was shooting for a hard limit on a memory tier for a cgroup that's similar to the v2 memory controller interface (see mail in the other thread). That interface should satisfy the hard constraint you want to place on the low priority jobs. Tim