Received: by 10.223.176.5 with SMTP id f5csp3986040wra; Mon, 29 Jan 2018 23:56:44 -0800 (PST) X-Google-Smtp-Source: AH8x227iebPaAEvJ3+wkFGxwLcdgfbbqmBpv/zT+8nTHvvbxp83SOg687M1CyyTBnFiF2aaApf5K X-Received: by 10.101.101.11 with SMTP id x11mr23937635pgv.130.1517299003940; Mon, 29 Jan 2018 23:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517299003; cv=none; d=google.com; s=arc-20160816; b=Eq/iii892ngHCbwby4ruiPIhzZEX66RXFPleAer2dYNGXlZfMa+XVjKnYdQ+yp7Bu4 /ndpd54Tmf8YIkwasXIDNoGSCWL7lxWVSeGJdxjkSGUpoh6Fyw2aNIkhyTMaUHzfjWVA rDSiLp7eGLzcmEmw079PPseJvuTXLphVj0Q3Z5oMpaU97t3CitwoNk/w6QWEIwjmwsNa gv/P9y/kDa6NHy+9wXXaLXvpFFWG02o7Ix1GSh5LDMS7zs8uhDWws9/lpj4RpE7j3CV+ UYDaAhpxs11j81ii3aocB1ZaDjlx5MoOsXez761WuDrxlQfgoPhGWhsvTaHRTa/3dKSU 1dxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=j4wPYfO/fc+XKUmSAiQpodTgDyl7O5kVnaAIIL9XORs=; b=Rkrvs6cWr9qx1yMGjguc1qpZItsnQdpAweeABGoeplN6ZOuHDVxQpsHJjrGpoSE/Mk d4TZSr72PPb6W80Qs9FEvqBjRnmI+u+t673qaOPl9umenkKQj/E0yc8ikd+0V+NHJELx ZWxcdxvZxssN+St1TQ/DoXhH34iGeR5MGyguri4gBd9DswCb+w9ofcEUoxDAtr8nYMWg nDpMxTGD9kwSehyYRG79akDiB3ypAI4gQpUthHx4J6HG6CgyC2mav18ueYzSMRqRqaIp zgLyl9pnQH5lABloQGEJA2OnGx+DwNVmlJbSKWfJAjuBC4dCRFW+8p83p1+K/ou+VHrP SM1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6-v6si11223556pls.316.2018.01.29.23.56.29; Mon, 29 Jan 2018 23:56:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbeA3Hz5 (ORCPT + 99 others); Tue, 30 Jan 2018 02:55:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:54700 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751521AbeA3Hz4 (ORCPT ); Tue, 30 Jan 2018 02:55:56 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 54B25ACAE; Tue, 30 Jan 2018 07:55:55 +0000 (UTC) Date: Tue, 30 Jan 2018 08:55:53 +0100 From: Michal Hocko To: "He, Roger" Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Koenig, Christian" Subject: Re: [PATCH] mm/swap: add function get_total_swap_pages to expose total_swap_pages Message-ID: <20180130075553.GM21609@dhcp22.suse.cz> References: <1517214582-30880-1-git-send-email-Hongbo.He@amd.com> <20180129163114.GH21609@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 30-01-18 02:56:51, He, Roger wrote: > Hi Michal: > > We need a API to tell TTM module the system totally has how many swap > cache. Then TTM module can use it to restrict how many the swap cache > it can use to prevent triggering OOM. For Now we set the threshold of > swap size TTM used as 1/2 * total size and leave the rest for others > use. Why do you so much memory? Are you going to use TB of memory on large systems? What about memory hotplug when the memory is added/released? > But get_nr_swap_pages is the only API we can accessed from other > module now. It can't cover the case of the dynamic swap size > increment. I mean: user can use "swapon" to enable new swap file or > swap disk dynamically or "swapoff" to disable swap space. Exactly. Your scaling configuration based on get_nr_swap_pages or the available memory simply sounds wrong. -- Michal Hocko SUSE Labs