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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 0FE00C2D0B1 for ; Tue, 4 Feb 2020 08:40:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B66DD21582 for ; Tue, 4 Feb 2020 08:40:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J0Vo5m0Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B66DD21582 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 698086B0005; Tue, 4 Feb 2020 03:40:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 647EE6B0006; Tue, 4 Feb 2020 03:40:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 585ED6B0007; Tue, 4 Feb 2020 03:40:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id 4297D6B0005 for ; Tue, 4 Feb 2020 03:40:52 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EB83C181AEF07 for ; Tue, 4 Feb 2020 08:40:51 +0000 (UTC) X-FDA: 76451799102.19.moon16_5ecb8aff8b861 X-HE-Tag: moon16_5ecb8aff8b861 X-Filterd-Recvd-Size: 5956 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 4 Feb 2020 08:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580805650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1mcqpowIMlMXjCE8lZVCLQ2PUQIf1hF826AJ7jaUjOQ=; b=J0Vo5m0Z6f5HUYEbvqkH393SJnY55zfhIScL3lyIhruZtaqqp3NjVRwi5xq+AEOIITkKuW mEdg5bYYuyN3Rw3/EgSaujuRGWIP2NJu9NtMAy69uWg/g3Sh+rF2eUIbPes9mjcrwPTprm SEcG1VHzY+KqBZv8+hzpe2Jl1LDR1bk= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-rjQZMGnaPKeqCuFJKkRcFA-1; Tue, 04 Feb 2020 03:40:47 -0500 Received: by mail-qv1-f69.google.com with SMTP id f17so11235730qvi.6 for ; Tue, 04 Feb 2020 00:40:47 -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=dQcQglLlCkKta4U1WBX30Y7XJKXYxvMIejb3t3w8x8I=; b=rplCQqvxGM8x2EtT2d7JoGyIPovukpRVoWlS2xyTKslKDfA46YCPsLMdQ6ZgmK0K+g jcqKwfWYHq0nAsLFvzFIoaudBOekoiHPtTOoviMhmvokqvMTr10CLJK83k9YBsEGkDZy npZvxzW7hUGpLw9rOljkwgFKD3cWFJvVE2BCynhjZZollcMzOFmc0rnam6Y1gS+FABBl Ocnd811Cn1KjyosCHIGrbXc9Oy0/rHRGTfZlSMaCh6aWuwK2Rn1WhHQsb3J+QhahCQEV fyvR3aOGJo4hk/q39ot7u9YDCIN5Q+Mhi+mjjKepm9AHgdYkN/tMCFJ6Ragy84CmaYm8 +Ngg== X-Gm-Message-State: APjAAAWjTbwRtcFPZUTbsvTO4206U85sKRyA12Ot77zeTfS5JIb12oxt wr351LpA5MNk9B3WgBXgVjmdeifBv12ArLNMDSTCulPKy18bKR5VBrLwOkMdweEbYpekfWgyTCq ufN2iFI1Al0w= X-Received: by 2002:a37:9fc9:: with SMTP id i192mr27239830qke.364.1580805646352; Tue, 04 Feb 2020 00:40:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyZbIFvON47XBsf+YxKwKbKbbnXPqprIXWv2YokTA2ouyLaOwtkMJDba1+q1B9SA1PuTcX72A== X-Received: by 2002:a37:9fc9:: with SMTP id i192mr27239806qke.364.1580805646091; Tue, 04 Feb 2020 00:40:46 -0800 (PST) Received: from redhat.com (bzq-109-64-11-187.red.bezeqint.net. [109.64.11.187]) by smtp.gmail.com with ESMTPSA id f28sm10663327qkk.130.2020.02.04.00.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 00:40:45 -0800 (PST) Date: Tue, 4 Feb 2020 03:40:40 -0500 From: "Michael S. Tsirkin" To: David Hildenbrand Cc: Nadav Amit , Alexander Duyck , Tyler Sanderson , "Wang, Wei W" , "virtualization@lists.linux-foundation.org" , David Rientjes , "linux-mm@kvack.org" , Michal Hocko Subject: Re: Balloon pressuring page cache Message-ID: <20200204033657-mutt-send-email-mst@kernel.org> References: <91270a68-ff48-88b0-219c-69801f0c252f@redhat.com> <75d4594f-0864-5172-a0f8-f97affedb366@redhat.com> <286AC319A985734F985F78AFA26841F73E3F8A02@shsmsx102.ccr.corp.intel.com> <20200203080520-mutt-send-email-mst@kernel.org> <5ac131de8e3b7fc1fafd05a61feb5f6889aeb917.camel@linux.intel.com> <539B606A-A0CA-4AA4-B99A-759C874A1EF8@vmware.com> MIME-Version: 1.0 In-Reply-To: X-MC-Unique: rjQZMGnaPKeqCuFJKkRcFA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 Tue, Feb 04, 2020 at 09:35:21AM +0100, David Hildenbrand wrote: > >>> I would say reverting probably makes sense. I'm not sure there is muc= h > >>> value to having a shrinker running deflation when you are actively tr= ying > >>> to increase the balloon. It would make more sense to wait until you a= re > >>> actually about to start hitting oom. > >> > >> I think the shrinker makes sense for free page hinting feature > >> (everything on free_page_list). > >> > >> So instead of only reverting, I think we should split it up and always > >> register the shrinker for VIRTIO_BALLOON_F_FREE_PAGE_HINT and the OOM > >> notifier (as before) for VIRTIO_BALLOON_F_MUST_TELL_HOST. >=20 > s/VIRTIO_BALLOON_F_MUST_TELL_HOST/VIRTIO_BALLOON_F_DEFLATE_ON_OOM/ >=20 > :) Well VIRTIO_BALLOON_F_MUST_TELL_HOST is also broken by shrinker with VIRTIO_BALLOON_F_FREE_PAGE_HINT as that code adds buffers but does not wait for them to be used even with VIRTIO_BALLOON_F_MUST_TELL_= HOST. We never noticed because QEMU does not advertize VIRTIO_BALLOON_F_MUST_TELL_HOST. > >> > >> (Of course, adapting what is being done in the shrinker and in the OOM > >> notifier) > >=20 > > David, > >=20 > > Please keep me posted. I decided to adapt the same solution as the virt= io > > balloon for the VMware balloon. If the verdict is that this is damaging= and > > the OOM notifier should be used instead, I will submit patches to move = to > > OOM notifier as well. >=20 > Will do. It all sounds sub-optimal to me at this point ... but I prefer > the old variant where a simple "drop_slab()" won't deflate the balloon. > That looks broken to me. Okay. Could you post a patch? > --=20 > Thanks, >=20 > David / dhildenb From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: Balloon pressuring page cache Date: Tue, 4 Feb 2020 03:40:40 -0500 Message-ID: <20200204033657-mutt-send-email-mst@kernel.org> References: <91270a68-ff48-88b0-219c-69801f0c252f@redhat.com> <75d4594f-0864-5172-a0f8-f97affedb366@redhat.com> <286AC319A985734F985F78AFA26841F73E3F8A02@shsmsx102.ccr.corp.intel.com> <20200203080520-mutt-send-email-mst@kernel.org> <5ac131de8e3b7fc1fafd05a61feb5f6889aeb917.camel@linux.intel.com> <539B606A-A0CA-4AA4-B99A-759C874A1EF8@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" To: David Hildenbrand Cc: "virtualization@lists.linux-foundation.org" , Tyler Sanderson , "linux-mm@kvack.org" , Nadav Amit , David Rientjes , Alexander Duyck , Michal Hocko List-Id: virtualization@lists.linuxfoundation.org On Tue, Feb 04, 2020 at 09:35:21AM +0100, David Hildenbrand wrote: > >>> I would say reverting probably makes sense. I'm not sure there is much > >>> value to having a shrinker running deflation when you are actively trying > >>> to increase the balloon. It would make more sense to wait until you are > >>> actually about to start hitting oom. > >> > >> I think the shrinker makes sense for free page hinting feature > >> (everything on free_page_list). > >> > >> So instead of only reverting, I think we should split it up and always > >> register the shrinker for VIRTIO_BALLOON_F_FREE_PAGE_HINT and the OOM > >> notifier (as before) for VIRTIO_BALLOON_F_MUST_TELL_HOST. > > s/VIRTIO_BALLOON_F_MUST_TELL_HOST/VIRTIO_BALLOON_F_DEFLATE_ON_OOM/ > > :) Well VIRTIO_BALLOON_F_MUST_TELL_HOST is also broken by shrinker with VIRTIO_BALLOON_F_FREE_PAGE_HINT as that code adds buffers but does not wait for them to be used even with VIRTIO_BALLOON_F_MUST_TELL_HOST. We never noticed because QEMU does not advertize VIRTIO_BALLOON_F_MUST_TELL_HOST. > >> > >> (Of course, adapting what is being done in the shrinker and in the OOM > >> notifier) > > > > David, > > > > Please keep me posted. I decided to adapt the same solution as the virtio > > balloon for the VMware balloon. If the verdict is that this is damaging and > > the OOM notifier should be used instead, I will submit patches to move to > > OOM notifier as well. > > Will do. It all sounds sub-optimal to me at this point ... but I prefer > the old variant where a simple "drop_slab()" won't deflate the balloon. > That looks broken to me. Okay. Could you post a patch? > -- > Thanks, > > David / dhildenb