Received: by 10.223.176.5 with SMTP id f5csp4314331wra; Tue, 30 Jan 2018 05:33:46 -0800 (PST) X-Google-Smtp-Source: AH8x224bSiZ1yuygzjJfTriwCZxhZ8aoOE9lqrrOtysiULknWQrrxXauJqytzbkn9rayoAFnzpOn X-Received: by 2002:a17:902:7897:: with SMTP id q23-v6mr4664552pll.166.1517319226659; Tue, 30 Jan 2018 05:33:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517319226; cv=none; d=google.com; s=arc-20160816; b=K4ljaI/sD+1d+AeRVr0exTZXlHCy8EgL5gLhkzT+BheYh1RbNNzmg1DIImk3s/P5zM XSZ5eJGZurxPokVVmikBcqW8F6afMUA0u3DT0kQw0/5BBu9cYVLmMlKIjrZ9+fjIN9Ar TS3/0yOQ7YiYtAifT8wcDZqvVQIiDON1hlAtZ1F7+qvsGkqXVrLofWP6G/5pEtXRe2jV EpUpBEBCjBh2Lf3jEWSL2JTNF2jeFfIaIjn7JgMMkg26AjV6eb8+zrLMoeXBTzp4oRL8 1rDtnC61FzYGLYWKiPinBvo/BHLYYe6q0uFeuoQB8ulP+OIX8cxPxFN/wzNusikSbvCd cnaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=Ky4c+AE65PMnIyJvProBjxW9WjZK0+1jAlZOuK21OaI=; b=CVJmC3CMC1yaDC3o0Rboq5njjIKcG/PSF2x+1+W+eA1zyHapo7PYu4zf+wuhgALSvq to+LMl5w2ptUXovx9AdjAGKXX2FWt9C1mbX3vGleO/uqAm8QV2vcBbErZXO6q7UuNV9K UPA/XW3rIlB74KTFbX88DKQ4Aos8cO+ycpQ819+LPHmUGRk00IQa7UiyA0b7/Nifu3WQ 7kLXNtr4WKatfuBEJXgxXTsng6vbanWrJro14cbJ5GZ+TVOl2aOW4QaI0tr8D1PjHTQ9 2/rP84637xEshMQ9MPe/9bYg1ipBxZbCz1GrozoqQ/qZG794iKyPkv2l9eU5v6m6TXQR MWug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Ie/lHYgf; 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 bh4-v6si3700835plb.14.2018.01.30.05.33.32; Tue, 30 Jan 2018 05:33:46 -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; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Ie/lHYgf; 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 S1752001AbeA3Mwf (ORCPT + 99 others); Tue, 30 Jan 2018 07:52:35 -0500 Received: from mail-sn1nam01on0068.outbound.protection.outlook.com ([104.47.32.68]:39648 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751714AbeA3Mwd (ORCPT ); Tue, 30 Jan 2018 07:52:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ky4c+AE65PMnIyJvProBjxW9WjZK0+1jAlZOuK21OaI=; b=Ie/lHYgfh740KqUpaqHtaQR4AqjXo3YIMOnzI9QWoe0QR2Nb0kkS+aLNR8n80boFrSxkvlAIRCuk7qqQ1TxhF/aI5GcL2zZBwLDubySeD4jhZeZ+49vAeYLIROeqv2uFnkgq45cdNm+wa6GANCLAdbqGv10lriN/X7UkOm03Jj8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christian.Koenig@amd.com; Received: from [IPv6:2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88] (2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88) by BN6PR12MB1299.namprd12.prod.outlook.com (10.168.227.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 12:52:30 +0000 Subject: Re: [PATCH] mm/swap: add function get_total_swap_pages to expose total_swap_pages To: Michal Hocko Cc: "He, Roger" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" References: <1517214582-30880-1-git-send-email-Hongbo.He@amd.com> <20180129163114.GH21609@dhcp22.suse.cz> <20180130075553.GM21609@dhcp22.suse.cz> <9060281e-62dd-8775-2903-339ff836b436@amd.com> <20180130101823.GX21609@dhcp22.suse.cz> <7d5ce7ab-d16d-36bc-7953-e1da2db350bf@amd.com> <20180130122853.GC21609@dhcp22.suse.cz> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <5ac13913-783d-26aa-ea5f-ab375f450f4c@amd.com> Date: Tue, 30 Jan 2018 13:52:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180130122853.GC21609@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88] X-ClientProxiedBy: VI1PR0202CA0028.eurprd02.prod.outlook.com (52.134.10.41) To BN6PR12MB1299.namprd12.prod.outlook.com (10.168.227.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7929b866-9744-42b3-bb94-08d567e05349 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:BN6PR12MB1299; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1299;3:1MmeMHMYIu7Mwdra39UpgMRSa1U18V/7qo8YaMR59tP+rjlAOf2duYX/GxGYyi5SFN9v30pK5ZX1mTfkJCj/korUsAUW5eL+Q34mkg5JjKM33o0VUemcaty3nWl6NXVvb1SwaJFFIM0c2ydeLHo7+HJBJhQsv16j5jQiDVUBnZVnxI0GRIj5SKklQ9MkjucmHnbN/JJMALtlQQvl476ilNrQr56TtC5iHIlgvleAJZD9GwKeutxpTVln16cHw1e2;25:GXQgVT56jF9IQ5oIWQEgzhDhRjDyxhlw/yNWfWMiIHzWmWSHTrceczRjH/Di4fz5CvWRnwMolWkAra36XzoVtys3MR4YCxx20iUM9aXlOi4CBRtHwADI5j8Immhk3KlUsxKcgNy3pSTTdeSMGxR+JZfZZCoYPOZAUtQBDxTn64rYjqYqx1QAwKaCKxm8W1KXa48vKhfPCu4Wk4hdEBMR9BT/RNEWDZtVFsJyw0yAtKw3pl7W2SCgBVEzZjybU/Zi6JcUdWX4UkLOXbIgGmZD6kTzd5r50IkJo5OH52VxmGTH5DMmOf81MBvSsZB5SekV6O/RrrtXwtl2bidN2fjDHw==;31:7MP4pxnidYNBJIvB9++xS0XeiHKCHJjqRL5WsBaqGZzAmH9f/pGYW0HFZGMIBOU8XF6Bs1yx0BndScT1/udL1nY1vOsZqgDrK1QZb9dUC/YxSR0vUVZNAjM6Nv8EOo0dlQs/VvLWMn5PBFq43iwp18K4ICVSm9vNxNT/7FLcN1ObyWDZ9aYwr/wsTMzppkJOuUhwCmrwVhXVU5BxpPbU0C4uAhzWUEbE+MotCpgwnes= X-MS-TrafficTypeDiagnostic: BN6PR12MB1299: X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1299;20:J8xpFMuV/Go8XbzvOY7dLM0eAuEVoUBnq4XiL3YgU7y+WZfwHAHar//X+miNPz6reWDRU7mvKr24l7P2L56Kg/AqoUJ3zLyJC80jGsAl//AWGOOmKFKcSVjSEZRCkGd8KDTgkxUaSi1p3m/VJ0XV/gzGxwJhOfXMTlXUYnSLYzqmd3kgReVst/QAX0sfbsdodyYRJrBZvVLjWfQorOAivZIcL5OUYgvpPG0ZIRVNrB6aDt/ozHxOzJD5zu0ailBK7Fr5u/xib2jPWnNRWC3c7nuc5fZhI4xR202canM1T8IYtwuomdMbjZCs/YsirMQkQNZLo3OB9p1BiqI7fj7gvy+Rfp+3YSSRnyB0/3xgf9d0NFuJyu7jb2W7YsI4838CGS9Jz+WnftRXuAgoefDmxnvC7ta+lIm6l+NpE2y3zUVpuME7+7wXFAsoNGTsAGou13g5wDZYt9P8Usr0KcsA9JKMceE4Kw1O4qt+j0Y4XDrTevwQtJD8aQJl8TM27AlX;4:jwRaI0fUW85S5txsGNRCa6pz4nnsXPoqWlZV/IBN3lxAEg5B6QJ8f45GkrK8A1I2CILuyhKkYLDULS+zsfL9F3cVJjr3xvmmZ1JJvd3J1nKsXIQ4JPLVR5zCsosrHxAi/CcGQF0dZhiU1MP5E5v5YINTpNSak78aLvi5N0ekonZQ2S7jWzHUyatzBT4Cef1J2S2oMtEgeSMzUX0h+OvBeRX5Fja7MjVLDWIJUWCWEhrhOzr+xWB4hRmQRg+640aRAT/gPPO4i3nufMHrwEDyRg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(944501161)(93006095)(93001095)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:BN6PR12MB1299;BCL:0;PCL:0;RULEID:;SRVR:BN6PR12MB1299; X-Forefront-PRVS: 0568F32D91 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(39380400002)(376002)(346002)(366004)(39860400002)(199004)(189003)(86362001)(1706002)(54906003)(6246003)(25786009)(2950100002)(5660300001)(50466002)(229853002)(386003)(16526019)(106356001)(58126008)(316002)(36756003)(230700001)(6666003)(105586002)(6116002)(53936002)(186003)(6916009)(4326008)(65826007)(97736004)(2906002)(83506002)(31686004)(65806001)(305945005)(76176011)(7736002)(67846002)(93886005)(2486003)(52396003)(52116002)(478600001)(64126003)(72206003)(65956001)(31696002)(68736007)(59450400001)(81156014)(81166006)(23676004)(8936002)(52146003)(8676002)(47776003)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1299;H:[IPv6:2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMjk5OzIzOjAwZjIwTE5PTEhOTndjeU5Pa1NiVmNEK1Uw?= =?utf-8?B?U0RHMWRTbnMwTTM2czFEbXhOZlRFTkdpVXBrWmJWeUduL3VHV2x5MVBJRDdJ?= =?utf-8?B?NENyL0NIblJldFlYb1JTeE1NMW9DWTRKa29DSXByMFpFcnJuRDBRUWhZSm8y?= =?utf-8?B?OVhJOG5SWGJnRmFzaEVQcHdxYmxjK3NUUWFISnpOSjIvVE1LNTAyN3pnMUlK?= =?utf-8?B?WHgvVWZvOGtrd2syOTJ5cEprY3o4Z1VQSGE2c3JJakpKK0ZTMFM5TEgvVnNs?= =?utf-8?B?R01MbGltaWY1NmQweEZUNERsQWVmVHA4VXlTWVZ6MnI2NERuUVBRZ2o3LzdI?= =?utf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X-MS-Exchange-CrossTenant-Network-Message-Id: 7929b866-9744-42b3-bb94-08d567e05349 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1299 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 30.01.2018 um 13:28 schrieb Michal Hocko: > I do think you should completely ignore the size of the swap space. IMHO > you should forbid further allocations when your current buffer storage > cannot be reclaimed. So you need some form of feedback mechanism that > would tell you: "Your buffers have grown too much". Yeah well, that is exactly what we are trying to do here. > If you cannot do > that then simply assume that you cannot swap at all rather than rely on > having some portion of it for yourself. There are many other users of > memory outside of your subsystem. Any scaling based on the 50% of resource > belonging to me is simply broken. Our intention is not reserve 50% of resources to TTM, but rather allow TTM to abort when more than 50% of all resources are used up. Rogers initial implementation didn't looked like that, but that is just a minor mistake we can fix. Regards, Christian.