Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3218922pxk; Mon, 5 Oct 2020 04:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEclB5qUibh80yoEuLs25ZUfvPQLtgr5LT2OPC8XwKuSv2l3SBJnswB8bVDn3PeiTkTgxU X-Received: by 2002:a17:906:c098:: with SMTP id f24mr15266893ejz.263.1601897270555; Mon, 05 Oct 2020 04:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601897270; cv=none; d=google.com; s=arc-20160816; b=jGTt8F9r/3rR+hy2jqTMlC4SDhEGk519Dp9VJaf+9iaS//cL1kCtyd+aEOX3OH4YIj sAqeo9MjOqbfYpSPFku7B186y7LMV98e8nhmQIhL/BmIFQarbtc+BbjW94li02hBskY6 w/z/dbxTPUJxhuz2CczeEDEFmsTdOUkk1BOH7quh0yYv+LKcWItNI70Yy57MeWipNEGW QDp+DNZcc4Ec7ZxcxAVKDsGTnty6YH1hxkelrcV8yW+a+hkS/EOVLSdWC1Nn6rNqhxtT HFPFOhxtbQKqdTxYoaAfic0/b9a1zxjl/G4QcYeTrrd+zj3nouMAP7vLkapYbR6dst35 2CHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dPmPVQgoIn6sm4yJEL6Gt5bZe3D8XUPMyhu5lemsH1w=; b=W7PBPv5ireJbq02zMRsJSoqQbQCkM+oFVo6Dm6uH9OAuHoleT7Rf9VokNS0kya/DET O3oQcYz5SbMlLJ6/ltCeyRwoeyqPqpNW0OKH9wn3Yxwz6OSGJTzFMpJTtOhpxB79XnFh 1EtT+Jnb4xBujWHQe3+naVcNkfy3S5yzs6yM4VcLOEkzUdzH5zRzqS18IfATQt2XmAtj 8xsBPYj51qjpyhd3ct4Ug6M/Sfclyff0TlB9NzBQSllZmB0GKt9aG0WG/aFdCDIxaIT7 1dzOwhzOOhVdg+uKm5r4kYX/lLhAy00qTHF6TRsf58/NejhQyfKiZqDR5fQv2Tu0TOEK niiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=JosLptL0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg11si6512438ejb.371.2020.10.05.04.27.27; Mon, 05 Oct 2020 04:27:50 -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; dkim=pass header.i=@chrisdown.name header.s=google header.b=JosLptL0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725891AbgJEL0H (ORCPT + 99 others); Mon, 5 Oct 2020 07:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbgJEL0B (ORCPT ); Mon, 5 Oct 2020 07:26:01 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABB07C0613AA for ; Mon, 5 Oct 2020 04:25:57 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id 33so8859330edq.13 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=BFcQCLlX3hcqKOgfDM+JWb7KVYXHi8VwTuESay15Vt+RE8JcKLI7hgGsdueuKA92LH KsfgL15CqKBLBgCFeqVqlc1+cprhKOYrVWGSsMGyJ6F96yu5r37n7zT64tzBovr+Myh0 XEvpLJhPKXInsJFcBl4BdXceYefwYVw3a+KL68L62G+HiSTcsh1z6N2sdx7NWP3V/qvB ipkzAMLpRPoAO6AUSNN+OopKcqDm972Dl0JbBmrdPnfmmSJiFn93KkX47Gp3sr/Y8pZd c7k3+ZG91an1UvkMH/935nImkoAG4tLcGtoCHpOr2wjHOosqv7LSOb8Nhi3SVDz3y47N AvwA== X-Gm-Message-State: AOAM531V5fR8oISs6aiYPwR9uHyKYJ0J6JuAMY4V63hfLy19QM01yOzH OrQv/3cAE5/TSDeMaETE7OOevg== 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.