Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2305146ybh; Mon, 9 Mar 2020 03:15:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsoZ96jz7nfgNzHxqA9b7g3n1unMxMPkdQSlSm54FhCD5NwZ9+OTtYY7JH4I26oND7dfcZY X-Received: by 2002:aca:d645:: with SMTP id n66mr2320501oig.66.1583748955648; Mon, 09 Mar 2020 03:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583748955; cv=none; d=google.com; s=arc-20160816; b=LiGPezr08lNhvB72RF0AdDvpu2Qpbfv40icTHPRyvdQ4v3AJJje4xkjYYNXJD9VvY/ QfxxgD6ckpni1abFAI5eX2ELcCSlGiSeX0aeuMLK2MiyGxGuzkYNTzFj74S+NnAIfBmb ozz25259inz+136XmrzHybx1+JxwEd4PCUf4V4BGbGyGAZ/Dln3FSeyLVN2EShKuwCoe cpkFK5fOZZYdSbYPyiCLt33CJ+SlpC+rL1LiJ2cToA+DakIwhxlCHwuBeNmAqRDjEPGO dacDnZxW47yLroJCbiWDrASsq57swttdzfcNOnyKB6uLK0XVBy4GMjekNOnxMOz5WMlY Wjyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=77GwOo3dJvMMY5EsUFtosa5OLtVohxUzfDzSlHPcPtQ=; b=uj+VYbrR8QgV/VnpvdSYK29xOI9dU1kOTel5ejVNXifYIqivxpSN6beGG8vLdP2d2C lYnjVU06YOvUWJ8mi+d+Zd0zGmo24mBL+T484gc+fFmCkGrZw80w45Nw5SjcLaNUlgil HYI/SXCUQLG7mbK/7MKpliufJbCh+YYK62XL3XsgRgpTF2MNPt7wWun0MsH7eWSlxKin pICU1LbVA+UT+bHvCfc5spRaFUApMYyLoTcTIgcVonFtpwDE9ld7Z0WOBVJGYRhKBWS0 Ak9UTCanWdBbD6oz1iElHvv3/M5lWevmtWdGaamgD9idP8hMTuhpwVuSOWti9qikTjtX /ZUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FWm5ApN3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13si3857574oil.161.2020.03.09.03.15.43; Mon, 09 Mar 2020 03:15:55 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=FWm5ApN3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726698AbgCIKPG (ORCPT + 99 others); Mon, 9 Mar 2020 06:15:06 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:50145 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726487AbgCIKPE (ORCPT ); Mon, 9 Mar 2020 06:15:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583748903; 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: in-reply-to:in-reply-to:references:references; bh=77GwOo3dJvMMY5EsUFtosa5OLtVohxUzfDzSlHPcPtQ=; b=FWm5ApN386cb+pwhYw10WgzwAANosnFk3z2TUkVd2mzrnS+ZDHNJcZEmoQeVdU2ONvpaT0 fR+RdVycpCPEYmH4HBKUxHhlrEJquHcUqZw5+q6ml6Gz3+Jb07cqoVap2BQz5vdNuCWjk/ hBYs/K2AcnhVapZ/B+P0+Zqcpmspaf8= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-FxeKOd15ML-b-WRMRzdYfw-1; Mon, 09 Mar 2020 06:15:02 -0400 X-MC-Unique: FxeKOd15ML-b-WRMRzdYfw-1 Received: by mail-qk1-f197.google.com with SMTP id w124so6911550qkd.19 for ; Mon, 09 Mar 2020 03:15:02 -0700 (PDT) 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=77GwOo3dJvMMY5EsUFtosa5OLtVohxUzfDzSlHPcPtQ=; b=rhfHuzvlMwpcELO9uhj/tdexT1KHxoqWH1Qr8DqNVdmFCKKYYYwf+lkZZJUSuJNxfz 1Ae8p8jGOCL9nZWLP2ZJjMw/EEBBxdjX08GrfY6lE7kE3AuyWmoLrAw+FJkwpirHWLbV dY1rBznwNNG1yugHFivLUBm4xqYPoKB5MfA40oilBS0hG/kFRla3fc7p9GWQtpxLwMXk xvoiHv7kK3YffXFdi1VnXLvaCUxsHUv6bo11mhvJY9+c3h2GZSZnCdlpqieUCxKYe/q6 1Y7wzwKceRc50fTNhJSUf0UDxvgyt44mgJZF+oiyn8AeKo4c93eAtcKif81Tasw1JKON HqUw== X-Gm-Message-State: ANhLgQ0cgxlDJIPl7T1q4RCz6oMxLPMyFGLtvGy7pzJdk3/PiWWfep4o 7k7qd4RFm237fSDnsWKCAlE5DjFSnK3NgM+kE/aGJYwv3UUcMrq7uaGTiQohCOSmGmzMvG5dKT/ efKI8Ir8Cju30jf3jTUX4eoBC X-Received: by 2002:a05:620a:45:: with SMTP id t5mr14504889qkt.183.1583748901945; Mon, 09 Mar 2020 03:15:01 -0700 (PDT) X-Received: by 2002:a05:620a:45:: with SMTP id t5mr14504877qkt.183.1583748901718; Mon, 09 Mar 2020 03:15:01 -0700 (PDT) Received: from redhat.com (bzq-79-178-2-19.red.bezeqint.net. [79.178.2.19]) by smtp.gmail.com with ESMTPSA id 184sm5164615qkh.63.2020.03.09.03.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 03:15:00 -0700 (PDT) Date: Mon, 9 Mar 2020 06:14:55 -0400 From: "Michael S. Tsirkin" To: David Hildenbrand Cc: Tyler Sanderson , linux-kernel@vger.kernel.org, linux-mm@kvack.org, virtualization@lists.linux-foundation.org, Wei Wang , Alexander Duyck , David Rientjes , Nadav Amit , Michal Hocko Subject: Re: [PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM Message-ID: <20200309061403-mutt-send-email-mst@kernel.org> References: <20200205163402.42627-1-david@redhat.com> <20200205163402.42627-4-david@redhat.com> <20200216044641-mutt-send-email-mst@kernel.org> <86453fed-1f39-dfcc-33c6-54241478e2ab@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86453fed-1f39-dfcc-33c6-54241478e2ab@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2020 at 10:03:14AM +0100, David Hildenbrand wrote: > On 08.03.20 05:47, Tyler Sanderson wrote: > > Tested-by: Tyler Sanderson > > > > Test setup: VM with 16 CPU, 64GB RAM. Running Debian 10. We have a 42 > > GB file full of random bytes that we continually cat to /dev/null. > > This fills the page cache as the file is read. Meanwhile we trigger > > the balloon to inflate, with a target size of 53 GB. This setup causes > > the balloon inflation to pressure the page cache as the page cache is > > also trying to grow. Afterwards we shrink the balloon back to zero (so > > total deflate = total inflate). > > > > Without patch (kernel 4.19.0-5): > > Inflation never reaches the target until we stop the "cat file > > > /dev/null" process. Total inflation time was 542 seconds. The longest > > period that made no net forward progress was 315 seconds (see attached > > graph). > > Result of "grep balloon /proc/vmstat" after the test: > > balloon_inflate 154828377 > > balloon_deflate 154828377 > > > > With patch (kernel 5.6.0-rc4+): > > Total inflation duration was 63 seconds. No deflate-queue activity > > occurs when pressuring the page-cache. > > Result of "grep balloon /proc/vmstat" after the test: > > balloon_inflate 12968539 > > balloon_deflate 12968539 > > > > Conclusion: This patch fixes the issue. In the test it reduced > > inflate/deflate activity by 12x, and reduced inflation time by 8.6x. > > But more importantly, if we hadn't killed the "grep balloon > > /proc/vmstat" process then, without the patch, the inflation process > > would never reach the target. > > > > Attached is a png of a graph showing the problematic behavior without > > this patch. It shows deflate-queue activity increasing linearly while > > balloon size stays constant over the course of more than 8 minutes of > > the test. > > Thanks a lot for the extended test! Given we shipped this for a long time, I think the best way to make progress is to merge 1/3, 2/3 right now, and 3/3 in the next release. > -- > Thanks, > > David / dhildenb