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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDA31C433F5 for ; Wed, 5 Oct 2022 17:25:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 532916B0072; Wed, 5 Oct 2022 13:25:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E27E6B0073; Wed, 5 Oct 2022 13:25:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 382126B0074; Wed, 5 Oct 2022 13:25:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 23BE46B0072 for ; Wed, 5 Oct 2022 13:25:53 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D67ED40FC8 for ; Wed, 5 Oct 2022 17:25:52 +0000 (UTC) X-FDA: 79987573344.10.5D436B4 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by imf30.hostedemail.com (Postfix) with ESMTP id 764FD8001B for ; Wed, 5 Oct 2022 17:25:52 +0000 (UTC) Received: by mail-pg1-f169.google.com with SMTP id 78so15772087pgb.13 for ; Wed, 05 Oct 2022 10:25:52 -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=bDmn+UG5XmxtqtoGhYVbuQvwTJey/ramGtEdWG8bl46dgKX2ctViMGWf7pcpouokAi MrQF1KlrkyO8y6vrKlBfy58SddiyYVwQxti5EfxxC3B3bumtvarJs6NxEJIGoR+9u4B1 jw97ge5cEwc2NHjnG1hLrtW2awrvNf+Q6sSOtY2tzwB0kTjRJ5Pb+C2K16FVC9+JgqOV zcdSD6xvKAqk/ZGh+/NF7fBkp5Cee639fGZor1zlnQl5TqZH3t1lSbaVRItlMMIrvIY7 6exJO0QIrI5umU4aDkYVdjqvQzEAb2b60TgLhRr/aoW5hFZjkZ095vefdP8MBL8Gm9YO zrQA== X-Gm-Message-State: ACrzQf3degyzBBrrv75D8BV+h4auEj9bGq8x7OcgNOC9/AOtIV7yA2PR W4X28ewJSioIupG+XS7/6Ks= X-Google-Smtp-Source: AMsMyM4TyVkvtTWOPo0nT5OoEytcoTQ9Csm4KgzKugBBadka1vCy2hdL+79TtN4k8+wmclpr81Shfg== 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) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664990752; h=from:from:sender: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:dkim-signature; bh=hoatWM9ozoryzp81ugwuVdaw9vFYVzmYTBOT17b7aaI=; b=tyK2RXZTCrU6qKYbgApND6vBYqvWtzukisnRFrxLItXg0GgbubkVVVpFFoRQs9YIU+dNyY 4VRR6FESv1eNL03cBXJuL5CMJdrs9XwWX493HeVJJ6fc5v5xzX84/P2UL6p0+3+rKJsTSN CBdWy9ouNBOuCsuRFMn9MtLbAI0XY2Y= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gIFf01eS; spf=pass (imf30.hostedemail.com: domain of nadav.amit@gmail.com designates 209.85.215.169 as permitted sender) smtp.mailfrom=nadav.amit@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664990752; a=rsa-sha256; cv=none; b=rPZxK1mCl4TNdRtQirzUCLUqX7JxGwn+jCPyHd/NaC1KrB0w08lGKFov3MkLeGr1mp+XF0 HcomaOyVpaR2pn4qA3H6SYYiBb/jU8f22wnHGyzpPXb/6jdwmHqf/2625X90tU3MRBSsv/ dhdosQFUvLLggqHilc8KcNP03oPRWik= X-Stat-Signature: 8reoa9omhsd4mm3iincpkyn48x943pw9 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 764FD8001B Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gIFf01eS; spf=pass (imf30.hostedemail.com: domain of nadav.amit@gmail.com designates 209.85.215.169 as permitted sender) smtp.mailfrom=nadav.amit@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-HE-Tag: 1664990752-602901 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 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?