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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 6F4EAC2BA83 for ; Fri, 14 Feb 2020 14:06:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C7AD2187F for ; Fri, 14 Feb 2020 14:06:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C7AD2187F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D07E96B0626; Fri, 14 Feb 2020 09:06:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CB87A6B0627; Fri, 14 Feb 2020 09:06:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF4FE6B0628; Fri, 14 Feb 2020 09:06:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id A49AD6B0626 for ; Fri, 14 Feb 2020 09:06:45 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 475C718039504 for ; Fri, 14 Feb 2020 14:06:45 +0000 (UTC) X-FDA: 76488908370.22.paint19_1dc63410f9915 X-HE-Tag: paint19_1dc63410f9915 X-Filterd-Recvd-Size: 4343 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Feb 2020 14:06:44 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id t3so11044511wru.7 for ; Fri, 14 Feb 2020 06:06:44 -0800 (PST) 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; bh=4/DviMTLAqxW+NTVLow2DllCrC7LZyuIIAbFynwyDuk=; b=eNPV8tcJHCr/J8xk6tx+IBZInBJpuuI81wR56y4d/9PIsKupFSMCpKKvabHUZreOYA vzw2zrcaqivUGzrlIgsPS5wXITjzyHHGscq1nSkvzGtELlJDp4WCg3KsWUQbXWBJ79F+ Ko9PteaZnKB2LY9bDAZVxkTXkV+zdUrBPf6LIC2ZBj3nyrDto0V2MY214yHxyVhLgUK9 ORum95xlVhoTdxk0UoGm7Q59yeovWbWuj+L6lAcfKlZaLXHNFWsJZtUz/7PB3Ybz0a5Y wzfH63fKHfNGOXJZUfukiebFLT4er8I7joDcw4ncLCiB4CCYVLO+6e6B1DtnGBDAywsg ZMsg== X-Gm-Message-State: APjAAAWt2RFgWgsP04Qax/BuTqEEBfjDzFpVPFwgAyLmuq5js1SOQIEC GAM8uD0KsfIblkwMIx1o5sQ= X-Google-Smtp-Source: APXvYqwqAYkIzT1DaMbqwJUULUwsZd6efBR4EsJ+5TXnBVtDKLC5Wnyppu4eiSOPMu38VVysNStKhA== X-Received: by 2002:adf:fa43:: with SMTP id y3mr4204102wrr.65.1581689203326; Fri, 14 Feb 2020 06:06:43 -0800 (PST) Received: from localhost (ip-37-188-133-87.eurotel.cz. [37.188.133.87]) by smtp.gmail.com with ESMTPSA id q14sm7263208wrj.81.2020.02.14.06.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 06:06:42 -0800 (PST) Date: Fri, 14 Feb 2020 15:06:41 +0100 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, virtualization@lists.linux-foundation.org, Tyler Sanderson , "Michael S . Tsirkin" , Wei Wang , Alexander Duyck , David Rientjes , Nadav Amit Subject: Re: [PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM Message-ID: <20200214140641.GB31689@dhcp22.suse.cz> References: <20200205163402.42627-1-david@redhat.com> <20200205163402.42627-4-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205163402.42627-4-david@redhat.com> 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: On Wed 05-02-20 17:34:02, David Hildenbrand wrote: > Commit 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker") > changed the behavior when deflation happens automatically. Instead of > deflating when called by the OOM handler, the shrinker is used. > > However, the balloon is not simply some slab cache that should be > shrunk when under memory pressure. The shrinker does not have a concept of > priorities, so this behavior cannot be configured. Adding a priority to the shrinker doesn't sound like a big problem to me. Shrinkers already get shrink_control data structure already and priority could be added there. > There was a report that this results in undesired side effects when > inflating the balloon to shrink the page cache. [1] > "When inflating the balloon against page cache (i.e. no free memory > remains) vmscan.c will both shrink page cache, but also invoke the > shrinkers -- including the balloon's shrinker. So the balloon > driver allocates memory which requires reclaim, vmscan gets this > memory by shrinking the balloon, and then the driver adds the > memory back to the balloon. Basically a busy no-op." > > The name "deflate on OOM" makes it pretty clear when deflation should > happen - after other approaches to reclaim memory failed, not while > reclaiming. This allows to minimize the footprint of a guest - memory > will only be taken out of the balloon when really needed. > > Especially, a drop_slab() will result in the whole balloon getting > deflated - undesired. Could you explain why some more? drop_caches shouldn't be really used in any production workloads and if somebody really wants all the cache to be dropped then why is balloon any different? -- Michal Hocko SUSE Labs