Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp548333ybl; Wed, 11 Dec 2019 03:53:27 -0800 (PST) X-Google-Smtp-Source: APXvYqyJZs3cUzppES2m8B0TaXEClJYQbg70eTpAYWByeZjnZbu1sRwVYuOtE0pTVuEUfZE8m+oT X-Received: by 2002:a05:6830:12c1:: with SMTP id a1mr1751826otq.357.1576065206784; Wed, 11 Dec 2019 03:53:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576065206; cv=none; d=google.com; s=arc-20160816; b=O7QfVNW2C5NccZ662bqaxRxxKOAOGyCsvAyT/Ww6ry2dDvWKqmTM41TCCxHWYHvLNI kogx0uHHN0tIunwDOiwR9SFkDIAc4iimxAyVvc25FC7mK9CwvUoGinCrbDLd/Bf4NMGD TvnlOPAJilrsSjMqiki90duQg7ZPqtxvQh4xsJbTUUrnJUZwPYj9IUmohtzp8QoumRPd 4xHXbBOeqjtxCWBphI5RCAYT2Co7HLIyVId530xiinHeFMIVPhJl7swoCRCBe+m+A9Dm UT2Bo3kj2lqrCWH/uGFv69jLKKvY/aLlRgwEjw+gGR3UWEYD0Qtw75+u6xoOswB3+LiR dOzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=9TzCrnHA+PZn9B0VHl+C0w3viSNbDpi/JT9IW5C14J8=; b=KV/g9K9tr2+PazVw1xI9qoD5VyBP4w0LquiFtzyF8ofs7Lk1Ok6QK9SG6zlyCxDScy gL+p7u+cs2/VZ8LirD5Q2WkoC5c3WadkHVLDoI/0iTFRtG2Pn16p33OUJ2fJMxnyJ6ce DYt0xniV94GvSja17UfhcT6JTn3MC/bHOm0sAm9fzupee72+IqpKo9DKR+oy5/xCLZvI Z7gpTHBdy4htWB/nhtUgPhSpEVgWxQ55t0o/qKiZbk62PT4z81Rh585rG+KoonBvtVrh pUaCz5i+iRAQ2PbtRY+Mn57RJuSGrEdbhOZNxiPAp0xzSaJL23v7LBDvlCkhCCQ8eAoI cIBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UujeKlbA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 25si1023002oiz.230.2019.12.11.03.53.14; Wed, 11 Dec 2019 03:53:26 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=UujeKlbA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729078AbfLKLwc (ORCPT + 99 others); Wed, 11 Dec 2019 06:52:32 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43162 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727365AbfLKLwb (ORCPT ); Wed, 11 Dec 2019 06:52:31 -0500 Received: by mail-pf1-f194.google.com with SMTP id h14so1693034pfe.10; Wed, 11 Dec 2019 03:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version:in-reply-to :content-transfer-encoding; bh=9TzCrnHA+PZn9B0VHl+C0w3viSNbDpi/JT9IW5C14J8=; b=UujeKlbA/oBu+duQfpkaL3iWHAaBqMPrF7H0W7jQ+M/FQL4G8ixiotVWbhuZwA6mje Kx9jOIhtvj/I2DcfkoMtR8dyzOO3+OnUz9MaH9Gf+2CTOpM/EmBjjs7i3p5ZuAiLz0Ea 08BRxmfZ06lHEMLrJFwYdFLInSybAcbbSP79HbIPXp/jNwUqmTJQMhs1kJOSQvz9dPgx v8ocNEB/RvbIWTs+3dT10kmLBlKe//mmrJeEhqfBvfJgRwHK7fPPaHlfYEOqaKUYj8A0 tzby5AOae+q83G01Pk6UoxEzeAAeSK/78cvydpBgx/IpBBS7yMDcDZ6OSN0cTCYKvdkH VAKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :in-reply-to:content-transfer-encoding; bh=9TzCrnHA+PZn9B0VHl+C0w3viSNbDpi/JT9IW5C14J8=; b=L9osX1Er4IKj7XhkkrTP5xMYKa12hau28kHjrF/bufogp5rdO/htVLuBYMBr+Rcpjz ePGhwpDP0abVTOPOc/alDNR3qa6Uuk8a7swLYPhPSd0soFiarbFMLIc9sD3gLKYXmMfZ +JAvCEibV4YtAEYwz6CorJ/yll3ESTcU87/9qRsVbaQhn2dhGxc5M+3yIslJAsQKuzcD cxKOHxgS3g3GxjyGY3S/eANCJD861Tv1ERCfziE5hultzGm8QAM4m+Kg5AkSYRwo1gwB nVqmsFiMIj2V+osSfP4V0jD82pvwTnqVic0QK1rDn2IxWShIkmGzXWrkW6GiYFy4vIF9 Vxcw== X-Gm-Message-State: APjAAAXY9nRBCvrI4aGZ/KnWOB0Sro/82IClodf1EZU/RqwyfZw0xWbe VAsrxW6nklaiNFraIr5X7Pk= X-Received: by 2002:a63:1c02:: with SMTP id c2mr3589205pgc.175.1576065150783; Wed, 11 Dec 2019 03:52:30 -0800 (PST) Received: from localhost.localdomain ([12.176.148.120]) by smtp.gmail.com with ESMTPSA id g18sm2921000pfi.80.2019.12.11.03.52.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2019 03:52:30 -0800 (PST) From: SeongJae Park To: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Cc: sjpark@amazon.com, axboe@kernel.dk, konrad.wilk@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, pdurrant@amazon.com, xen-devel@lists.xenproject.org, SeongJae Park Subject: Re: Re: Re: [PATCH v5 1/2] xenbus/backend: Add memory pressure handler callback Date: Wed, 11 Dec 2019 12:52:08 +0100 Message-Id: <20191211115208.14583-1-sj38.park@gmail.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 In-Reply-To: <20191211105112.GK980@Air-de-Roger> (raw) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Dec 2019 11:51:12 +0100 "Roger Pau Monné" wrote: > > On Tue, 10 Dec 2019 11:16:35 +0100 "Roger Pau Monné" wrote: > > > > diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h > > > > index 869c816d5f8c..cdb075e4182f 100644 > > > > --- a/include/xen/xenbus.h > > > > +++ b/include/xen/xenbus.h > > > > @@ -104,6 +104,7 @@ struct xenbus_driver { > > > > struct device_driver driver; > > > > int (*read_otherend_details)(struct xenbus_device *dev); > > > > int (*is_ready)(struct xenbus_device *dev); > > > > + unsigned (*reclaim)(struct xenbus_device *dev); > > > > > > ... hence I wonder why it's returning an unsigned when it's just > > > ignored. > > > > > > IMO it should return an int to signal errors, and the return should be > > > ignored. > > > > I first thought similarly and set the callback to return something. However, > > as this callback is called to simply notify the memory pressure and ask the > > driver to free its memory as many as possible, I couldn't easily imagine what > > kind of errors that need to be handled by its caller can occur in the callback, > > especially because current blkback's callback implementation has no such error. > > So, if you and others agree, I would like to simply set the return type to > > 'void' for now and defer the error handling to a future change. > > Yes, I also wondered the same, but seeing you returned an integer I > assumed there was interest in returning some kind of value. If there's > nothing to return let's just make it void. > > > > > > > Also, I think it would preferable for this function to take an extra > > > parameter to describe the resource the driver should attempt to free > > > (ie: memory or interrupts for example). I'm however not able to find > > > any existing Linux type to describe such resources. > > > > Yes, such extention would be the right direction. However, because there is no > > existing Linux type to describe the type of resources to reclaim as you also > > mentioned, there could be many different opinions about its implementation > > detail. In my opinion, it could be also possible to simply add another > > callback for another resource type. That said, because currently we have an > > use case and an implementation for the memory pressure only, I would like to > > let it as is for now and defer the extension as a future work, if you and > > others have no objection. > > Ack, can I please ask the callback to be named reclaim_memory or some > such then? Yes, I will change the name. Thanks, SeongJae Park > > Thanks, Roger. >