Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp7249180imm; Sun, 20 May 2018 22:41:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpAFHtj5EmCvA55hNAnXVol1KU3RvOmBK8u8PPFe9Tv4fpVWW4PBcUCNvplfaQooVbVhW78 X-Received: by 2002:aa7:80c6:: with SMTP id a6-v6mr18619406pfn.120.1526881306847; Sun, 20 May 2018 22:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526881306; cv=none; d=google.com; s=arc-20160816; b=keFoalwP9qVt5jAC0n+GRw5WqkYmbXvtpSASeFMwmZEEZwlXtPLw4o6tCDjcn+nJGs qB30U5YBEfZahYSlTnKdRyaxAuBj+BT2BLHZZhxKS7gParwF/ivG85TMlyVwU3WNo6Da LT3/PNahmm2HctpTguk/NLaeIEWh9UPJFwYIpqqpncoRIhoIQoSFTnHYHCo6r2JKvvVd w7Iyfa/MdvlSURZYP3wT3nKgr5CUFnyeJv4Knv8NjdeF2Z5U0cikQz1ILwFQWcawvCPC jAjzKddgCUBnwexcAnoR3wT791MrdlStdMOqUN8DPLsEhtEOI46FmDKtWms6SWMdHzwb EINg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=ePYqN0JMGe9jf8YuCWx/0JEF93ZBL0IJzx6vjhVDRxM=; b=zwUohYs/gKlcKHHUlUQRjOdYScL4QCMzeH4gZJ0tPx/CnQ/34KNpFYZ85jtSoYPRdX g7vJgEahcNpLom8iTeafU+0h77nQt57RbyX741lWPtn7wPGqv9cmSjgoN+uO1GDHn6kw FTlxiBg3CPvJRsUvCVu680pGpD7bCLjEuZgC1XfYXFjtRtNjlpK8naqfn+gc+NeQl95G SYtNU62omsnCY4gnb+4x+JPSfa1Q/5uk9z8iZU5K0qf0BEUWba8fyC6Oy6Chd9wDjqfn 6VpbIqG9GqXbItEDh8k52N7T5kCCVmhGxYygBi1WAHLXThR4hTnXwaoSoWeKJfEZh3Zw 72vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aqyBi7ux; 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 i63-v6si10361387pge.436.2018.05.20.22.41.32; Sun, 20 May 2018 22:41:46 -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=@gmail.com header.s=20161025 header.b=aqyBi7ux; 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 S1751108AbeEUFkg (ORCPT + 99 others); Mon, 21 May 2018 01:40:36 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:40662 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbeEUFkf (ORCPT ); Mon, 21 May 2018 01:40:35 -0400 Received: by mail-lf0-f68.google.com with SMTP id u140-v6so9792234lff.7; Sun, 20 May 2018 22:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=ePYqN0JMGe9jf8YuCWx/0JEF93ZBL0IJzx6vjhVDRxM=; b=aqyBi7uxvb+QYPYTSkv4Jf62dedlMKQD9UEuOVZScHGSP+b4zeB4+6inj0moMzfOc7 tgzteNbZxPkFZ/hhRJive4JizC1TwIJd0UfvVN7gsBqHyun0Btenjk/ZuhYCpEIw6xLA hUUbu09j3/tPmJNGtXxFEykyKX07CEc5G76dsRGCFuhzkSgRDteceof+F3KrHV96bqzq NMrJgyZH8ZJjSGnQXe+GFbL5Y8tIkDuMe9CNo6GDuSKVClo8SQ/av17ov+ZFqPsVkfRG 10nDNac+Z1TdS2A4gi0fOK0/5G9W8xoW3DITG2lNwtWmhJtlaQGIXuNVOdZiOcfh5tkV 4jeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ePYqN0JMGe9jf8YuCWx/0JEF93ZBL0IJzx6vjhVDRxM=; b=mIgCQS1HU3CPmhc2IlL1zBnPV5qmuhHGdZUTsnDXXgiQgNKsBYJH5UY0IfKzNVy9Ek pdazir4gYLAJa1bOYhDMjIfkD1MccAaJ9hUzvhU09Z3SqJ2uZVv93H9J4TWDAPGsR6qN DLJMeoYwg3V3jASKzD77u0C3YjSVD9XUh0fhQ/AOb3NpgmbDsFEq0wYIKFrosowNw3VP gLhmiEf0nHuIM1o/SnTbR+q0Y7BoKkdDfj2jdYGudWhpaep3+fr9D2q1b9pDSGKEJzvI NUy78JzfQyccAWWWTSqYJpGfr9iWmVzaZ6kNdFZER2VOjZtM8ZdTiGxRCrLHsR6MBVjf yYUQ== X-Gm-Message-State: ALKqPwdMN93a7NjVoTHm/SsMyrJRiOLLPx/QxhIWTPyT/Co3xVWRoksa S1zw6TC/csyJcHOtfJJ6zAw= X-Received: by 2002:a2e:7d1a:: with SMTP id y26-v6mr10571593ljc.135.1526881233239; Sun, 20 May 2018 22:40:33 -0700 (PDT) Received: from [10.17.182.9] (ll-52.209.223.85.sovam.net.ua. [85.223.209.52]) by smtp.gmail.com with ESMTPSA id j188-v6sm3232258lfg.52.2018.05.20.22.40.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 22:40:31 -0700 (PDT) Subject: Re: [Xen-devel] [RFC 1/3] xen/balloon: Allow allocating DMA buffers To: Boris Ostrovsky , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, jgross@suse.com, konrad.wilk@oracle.com Cc: daniel.vetter@intel.com, matthew.d.roper@intel.com, dongwon.kim@intel.com, Oleksandr Andrushchenko References: <20180517082604.14828-1-andr2000@gmail.com> <20180517082604.14828-2-andr2000@gmail.com> <6a108876-19b7-49d0-3de2-9e10f984736c@oracle.com> From: Oleksandr Andrushchenko Message-ID: <9541926e-001a-e41e-317c-dbff6d687761@gmail.com> Date: Mon, 21 May 2018 08:40:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <6a108876-19b7-49d0-3de2-9e10f984736c@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/19/2018 01:04 AM, Boris Ostrovsky wrote: > On 05/17/2018 04:26 AM, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko > > A commit message would be useful. Sure, v1 will have it > >> Signed-off-by: Oleksandr Andrushchenko >> >> for (i = 0; i < nr_pages; i++) { >> - page = alloc_page(gfp); >> - if (page == NULL) { >> - nr_pages = i; >> - state = BP_EAGAIN; >> - break; >> + if (ext_pages) { >> + page = ext_pages[i]; >> + } else { >> + page = alloc_page(gfp); >> + if (page == NULL) { >> + nr_pages = i; >> + state = BP_EAGAIN; >> + break; >> + } >> } >> scrub_page(page); >> list_add(&page->lru, &pages); >> @@ -529,7 +565,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) >> i = 0; >> list_for_each_entry_safe(page, tmp, &pages, lru) { >> /* XENMEM_decrease_reservation requires a GFN */ >> - frame_list[i++] = xen_page_to_gfn(page); >> + frames[i++] = xen_page_to_gfn(page); >> >> #ifdef CONFIG_XEN_HAVE_PVMMU >> /* >> @@ -552,18 +588,22 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) >> #endif >> list_del(&page->lru); >> >> - balloon_append(page); >> + if (!ext_pages) >> + balloon_append(page); > > So what you are proposing is not really ballooning. You are just > piggybacking on existing interfaces, aren't you? Sort of. Basically I need to {increase|decrease}_reservation, not actually allocating ballooned pages. Do you think I can simply EXPORT_SYMBOL for {increase|decrease}_reservation? Any other suggestion? > -boris > > Thank you, Oleksandr