Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2222243rwb; Wed, 5 Oct 2022 10:46:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PM+5VA7ExfNz1tSmdA7PvzHci2FjJOOIOIxExSY13HJBLF/VSpoyr2P1amtgKtmJTA+yM X-Received: by 2002:a17:902:d353:b0:178:8976:e78f with SMTP id l19-20020a170902d35300b001788976e78fmr535664plk.68.1664991988851; Wed, 05 Oct 2022 10:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664991988; cv=none; d=google.com; s=arc-20160816; b=vIKBN320gxRHD9wvnp23DGpeC7AtPCJG9DoN9JL1yapMDoH/vl6KsknJsFMjqMdFed gMWlaVM+ADV9r09rJ7u3L4SJ6MeHDqMqF+rKm3/gcpMHljLiO4Etu5C8qPkUR7hJdnuG JXWT1HmzHI4T+rnxAQYmq/lUSMmhVz63a1VIBUjyX3qPnQWrtS7U4LXOCFB8Vc6dO87n 8dDoEG7yevmUPuywqFY9iMbM72hS99igW0473u+3Zus4fCo6d+uNDDwNXDF8PbtX90AK yEvP+SebZ0CDNftn0KsGwLgcoG34KJdATS0mWoTF0YIIsgnN775Jp6j9pE7FcP8/ctIW AQLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=hoatWM9ozoryzp81ugwuVdaw9vFYVzmYTBOT17b7aaI=; b=lNPTqa4kPwjXZAuwHzuXejipu/W4GgJoou0F8f8WpAa5ZCNgfn1MtVIo5fRBHKtxnW JMWpyZ76/khL9Wcd0O4vyQQqCsnkwM7L06QDb+uLDyQcpR1Zb0UPXLmxs/W0xUFbILnH jSdEMiu1hGUIbZlb6XscvnNmgvd4jhWw+CqBGg05MVKkxuI0BPi+tt56rhO4li1Jq0v3 q7yXEytT+7M33yNOUpDF1JvFXaM2KHd7q5Pxa0kkS5c/5kdLw6dGWxsN8fjwFbPzQMJn VCSAIAcWhqjM7oR+6Dko3Ziv/A3pLNOTt7cIwq7KUnpKTCE8q5iPZuvGG0GfZbXHImG+ VT2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gIFf01eS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a17090341d100b0017bdf43925dsi17266731ple.580.2022.10.05.10.46.16; Wed, 05 Oct 2022 10:46:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gIFf01eS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230234AbiJERZ4 (ORCPT + 99 others); Wed, 5 Oct 2022 13:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiJERZx (ORCPT ); Wed, 5 Oct 2022 13:25:53 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6F417DF75 for ; Wed, 5 Oct 2022 10:25:51 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id c7so15791797pgt.11 for ; Wed, 05 Oct 2022 10:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date; bh=hoatWM9ozoryzp81ugwuVdaw9vFYVzmYTBOT17b7aaI=; b=gIFf01eSbK2nZVpULQQ42DWnKsnifrnfUC3C+n75VahsZLw6X4vzvAE2VCPE1j48X0 IaaNKd/qYL8krO6D3d/aoP9gMlWpx+y3lL7NClxUYU53fEDEEhbfVvZ7aE0aqvAmV4IK 3y2vFjqYCsjN97+iPd/YqH2yMZej0l7hTXKxgH2VLxsIVo9OOIqo5v/PBf19pcnriVOx t/1ieEGtExO1t8rBxYT+5frSnex7m46Hec+pQZzYr1Eu3vJbnWH5zukHNd0QoGHb6DNu cBOPZ9XSaw1Li4xEvr8wnq6qlZhHieRk/DcIuLbLP5LbN2Sjnc8DBnkr7+yceNvIu8Nw zaDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=hoatWM9ozoryzp81ugwuVdaw9vFYVzmYTBOT17b7aaI=; b=YfgrQw2WWPwYS7vV1HS0N3DB7tdfXFRc9OPWNpsODeSU0MYbCpF5py6HoblsqNCp6Q NGDAKWBlFkc+XCNBnFXkBGhwlNIr1pLoOOKft0PwPj+UAD45n4l+akxn0JgeMoc9kApy xw9lR0xK8I4vQqRjUhcVkBxxc9a0jrBDszqMWMARQeG4qlBnANNu6/uPd2r378r6bvsi aYZEx08Smjc7B69scEXTG+EviDFFZyXoYXGXNRXNWbwfXaEeG6PNE8ISQFzX2WPpa8c+ JFqAUsvuTftL1xO0aKD8OWwFM7jlC6xhLY+YYpvv/ZSYDUzfAS3250qrDRYEPtmySEpV YYdQ== X-Gm-Message-State: ACrzQf3UmHURXE5J5POsJJokxX1cL+d0CBYmGwDQVCpZPB91K7nTIQsb i8meH/ASa2R8cpRgxz57TP9fC5XoUJjfcg== X-Received: by 2002:a05:6a02:186:b0:439:49a3:479b with SMTP id bj6-20020a056a02018600b0043949a3479bmr733364pgb.171.1664990751147; Wed, 05 Oct 2022 10:25:51 -0700 (PDT) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id j7-20020a170902690700b00176b84eb29asm1777510plk.301.2022.10.05.10.25.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Oct 2022 10:25:50 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: [PATCH v4 2/7] Enable balloon drivers to report inflated memory From: Nadav Amit In-Reply-To: <20221005090158.2801592-3-alexander.atanasov@virtuozzo.com> Date: Wed, 5 Oct 2022 10:25:47 -0700 Cc: "Michael S. Tsirkin" , David Hildenbrand , Andrew Morton , kernel@openvz.org, Linux Virtualization , LKML , linux-mm@kvack.org Content-Transfer-Encoding: quoted-printable Message-Id: <88EDC41D-408F-4ADF-A933-0A6F36E5F262@gmail.com> References: <20221005090158.2801592-1-alexander.atanasov@virtuozzo.com> <20221005090158.2801592-3-alexander.atanasov@virtuozzo.com> To: Alexander Atanasov X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Oct 5, 2022, at 2:01 AM, Alexander Atanasov = wrote: > Add counters to be updated by the balloon drivers. > Create balloon notifier to propagate changes. I missed the other patches before (including this one). Sorry, but next time, please cc me. I was looking through the series and I did not see actual users of the notifier. Usually, it is not great to build an API without users. [snip]=20 > + > +static int balloon_notify(unsigned long val) > +{ > + return srcu_notifier_call_chain(&balloon_chain, val, NULL); Since you know the inflated_kb value here, why not to use it as an = argument to the callback? I think casting to (void *) and back is best. But you = can also provide pointer to the value. Doesn=E2=80=99t it sound better than = having potentially different notifiers reading different values? Anyhow, without users (actual notifiers) it=E2=80=99s kind of hard to = know how reasonable it all is. For instance, is it balloon_notify() supposed to prevent further balloon inflating/deflating until the notifier = completes? Accordingly, are callers to balloon_notify() expected to relinquish = locks before calling balloon_notify() to prevent deadlocks and high latency?