From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A98AC4363A for ; Mon, 5 Oct 2020 11:26:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B170E20774 for ; Mon, 5 Oct 2020 11:25:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="JosLptL0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B170E20774 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1CBA46B005D; Mon, 5 Oct 2020 07:25:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17C576B0062; Mon, 5 Oct 2020 07:25:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 044086B0068; Mon, 5 Oct 2020 07:25:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id CCC566B005D for ; Mon, 5 Oct 2020 07:25:58 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 67F2B3630 for ; Mon, 5 Oct 2020 11:25:58 +0000 (UTC) X-FDA: 77337642396.29.dock59_3c04f8c271bd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 2F5C318086CC2 for ; Mon, 5 Oct 2020 11:25:58 +0000 (UTC) X-HE-Tag: dock59_3c04f8c271bd X-Filterd-Recvd-Size: 4568 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Mon, 5 Oct 2020 11:25:57 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id c8so8888472edv.5 for ; Mon, 05 Oct 2020 04:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dPmPVQgoIn6sm4yJEL6Gt5bZe3D8XUPMyhu5lemsH1w=; b=JosLptL0NIYq+WTt2D0GcnMU8aGMTGaKjauLfSJh/SVg8Fre3RjwOL+f/2Qg5zcYBt yycq3AmSW1jW+/cKoAFeJBtiQ2pPJYKD7TsXrW+AvAeW/VThIIijdDj3eD7cuBZOKPpE FEeXT4yrqri3+HgiZxDuKbeQZwMpctrogyfI4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dPmPVQgoIn6sm4yJEL6Gt5bZe3D8XUPMyhu5lemsH1w=; b=APqW8fLiYJSqRI3Q9S5o+6fFZRxW3jevdoX8Mn5xjbE5yUGuW3/k/fl1KZJZomFn8A BpMT6FQapHSS0iXTol3mjYtmnh+r8O9itMqrb9GaCm55vpFqgGXy94LlhNSewRsZFNr4 b4aaNIRY7i7tI/Fzxg9zDGFuiyVvi4lq7EPQnYavgwcRAX+Mx4YmWn93BygL3Ib5YLVz JhLBtQz9Srl7qzZCR3zBIVuIcA/Nvj7ffCVcljLmMzplBhq5rgCfievdlNdeSHXZTOCO jJ3PtTYG7YniHs70k2hmwPCy+L9rGjqGgWlj2WWdbkl4zNOw/DQHd1Beih3VDsHMKOlh cEgw== X-Gm-Message-State: AOAM533Ijg+OAdt619kTRGF87xIYkkSfyb95pPMgqIOeN4xB/0PyCaRo QfjhRT+ERE/p91bVALAcNJcIDg== X-Google-Smtp-Source: ABdhPJwEUfB3faVj/+aqL4T2iZayUJerxEobuZPlfEhjF4pUatcxjdChp6vol2nisp1EgAYCOwThVw== X-Received: by 2002:a50:9a86:: with SMTP id p6mr16361020edb.96.1601897156284; Mon, 05 Oct 2020 04:25:56 -0700 (PDT) Received: from localhost ([2620:10d:c093:400::5:b1f1]) by smtp.gmail.com with ESMTPSA id p17sm8712908edw.10.2020.10.05.04.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 04:25:55 -0700 (PDT) Date: Mon, 5 Oct 2020 12:25:55 +0100 From: Chris Down To: Andrea Righi Cc: Michal Hocko , Vladimir Davydov , Li Zefan , Tejun Heo , Johannes Weiner , Andrew Morton , Luigi Semenzato , "Rafael J . Wysocki" , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH RFC v2] Opportunistic memory reclaim Message-ID: <20201005112555.GA108347@chrisdown.name> References: <20201005081313.732745-1-andrea.righi@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201005081313.732745-1-andrea.righi@canonical.com> User-Agent: Mutt/1.14.7 (2020-08-29) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Andrea Righi writes: >This feature has been successfully used to improve hibernation time of >cloud computing instances. > >Certain cloud providers allow to run "spot instances": low-priority >instances that run when there are spare resources available and can be >stopped at any time to prioritize other more privileged instances [2]. > >Hibernation can be used to stop these low-priority instances nicely, >rather than losing state when the instance is shut down. Being able to >quickly stop low-priority instances can be critical to provide a better >quality of service in the overall cloud infrastructure [1]. > >The main bottleneck of hibernation is represented by the I/O generated >to write all the main memory (hibernation image) to a persistent >storage. > >Opportunistic memory reclaimed can be used to reduce the size of the >hibernation image in advance, for example if the system is idle for a >certain amount of time, so if an hibernation request happens, the kernel >has already saved most of the memory to the swap device (caches have >been dropped, etc.) and hibernation can complete quickly. Hmm, why does this need to be implemented in kernelspace? We already have userspace shrinkers using memory pressure information as part of PID control already (eg. senpai). Using memory.high and pressure information looks a lot easier to reason about than having to choose an absolute number ahead of time and hoping it works.