Received: by 10.223.176.5 with SMTP id f5csp547959wra; Sat, 27 Jan 2018 05:14:10 -0800 (PST) X-Google-Smtp-Source: AH8x227ynjb47vxUhUc1CasuZCMSPNiTTDt+21UuLxEtM8pxNPs8jD0O87yUpGQeooojtpXNYngB X-Received: by 10.99.115.24 with SMTP id o24mr2550898pgc.415.1517058850469; Sat, 27 Jan 2018 05:14:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517058850; cv=none; d=google.com; s=arc-20160816; b=WeD3HuTuuiG5fDK2UK73fPpDk6XFoNltlOFnwc5z+f1kmQFlghWdsDOHy53CQmkLzD D4Nn42xmEmaPyz1XOoBi2xStuZ6bQqo/CZ1u5nxOU3TACWK3d9RtqDaCS+bnFMvwllwi 1RpY2cPxvVdTJYkE13vnGNOx8I9LxeR153a23aKcGCc7AFOn9cj54gq6/pxlPT1Bz/HN GfEJCcJGsot8ZDMtZpXPA994T16Wf4+Z+tr6zC/ZT9fxjgZYA3Y5BITfljmE5Tm5B4aR MlovEdWptRB3+r7fs4H/zJaKHhkQuDwYp57fh4lcBCMvQ8404gDJqgMknzZVTryAdBfm abJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=B0vAkGTab6JubgZ1IUGvAPmbCEPnBICJzq816+/6oZs=; b=0ckRSGy/lFGWViuKaSbznAz2MPwhxnNfTE1KsbFysSd9VUB70l8OvIbhOVlL3VVc7r ygyRt2jIv6sQoYaP7XdfzlaogNLacGmHyJgCVYCIW9waWompxH2ASGdqOr6ZTAVX6V+u OJcSO/PnCOarQJNBQf850D7AAeuswDfb0BXVy7N7PC5fisso020SwXoyzOC8RIWijRje Y+LP593d/KDjW2f3JHBZqkcowgMSQYAQuDXofYPbFL1dMuhDbTm2OMEDs9zFeuXri/NT JrsGFVsRQuEsURSz+3OgX6pgyB9K9Rzhi/J18KrcRPjbtIp2nXUaXAZDQnvc1He72+q7 cCcA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si4411085pgs.536.2018.01.27.05.13.46; Sat, 27 Jan 2018 05:14:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbeA0NNL convert rfc822-to-8bit (ORCPT + 99 others); Sat, 27 Jan 2018 08:13:11 -0500 Received: from mga02.intel.com ([134.134.136.20]:1735 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751904AbeA0NNJ (ORCPT ); Sat, 27 Jan 2018 08:13:09 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jan 2018 05:13:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,422,1511856000"; d="scan'208";a="25885793" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 27 Jan 2018 05:13:08 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 27 Jan 2018 05:13:08 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 27 Jan 2018 05:13:08 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Sat, 27 Jan 2018 21:13:06 +0800 From: "Wang, Wei W" To: "Michael S. Tsirkin" CC: "virtio-dev@lists.oasis-open.org" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-mm@kvack.org" , "mhocko@kernel.org" , "akpm@linux-foundation.org" , "pbonzini@redhat.com" , "liliang.opensource@gmail.com" , "yang.zhang.wz@gmail.com" , "quan.xu0@gmail.com" , "nilal@redhat.com" , "riel@redhat.com" Subject: RE: [PATCH v24 1/2] mm: support reporting free page blocks Thread-Topic: [PATCH v24 1/2] mm: support reporting free page blocks Thread-Index: AQHTlQLHX0WLqDggdUyY4fn0grJ+UqOEFDWAgAFtc4CAADrtgIAAcMGAgAGG3JA= Date: Sat, 27 Jan 2018 13:13:05 +0000 Message-ID: <286AC319A985734F985F78AFA26841F7393ED398@SHSMSX101.ccr.corp.intel.com> References: <1516790562-37889-1-git-send-email-wei.w.wang@intel.com> <1516790562-37889-2-git-send-email-wei.w.wang@intel.com> <20180125152933-mutt-send-email-mst@kernel.org> <5A6AA08B.2080508@intel.com> <20180126155224-mutt-send-email-mst@kernel.org> <20180126233950-mutt-send-email-mst@kernel.org> In-Reply-To: <20180126233950-mutt-send-email-mst@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2FhNzc2MjAtOTNjMi00NmJiLWFiNTItYTE2OTEwZjE3OGY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlpqQm0rSVdISmg1TEpYZU82QURRVFNWSitBNlBJYkdYSlFVSVdaaDJCdHc9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday, January 27, 2018 5:44 AM, Michael S. Tsirkin wrote: > On Fri, Jan 26, 2018 at 05:00:09PM +0200, Michael S. Tsirkin wrote: > > On Fri, Jan 26, 2018 at 11:29:15AM +0800, Wei Wang wrote: > > > On 01/25/2018 09:41 PM, Michael S. Tsirkin wrote: > > > > On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: > > > 2) If worse, all the blocks have been split into smaller blocks and > > > used after the caller comes back. > > > > > > where could we continue? > > > > I'm not sure. But an alternative appears to be to hold a lock and just > > block whoever wanted to use any pages. Yes we are sending hints > > faster but apparently something wanted these pages, and holding the > > lock is interfering with this something. > > I've been thinking about it. How about the following scheme: > 1. register balloon to get a (new) callback when free list runs empty 2. take > pages off the free list, add them to the balloon specific list 3. report to host 4. > readd to free list at tail 5. if callback triggers, interrupt balloon reporting to > host, > and readd to free list at tail So in step 2, when we walk through the free page list, take each block, and add them to the balloon specific list, is this performed under the mm lock? If it is still under the lock, then what would be the difference compared to walking through the free list, and add each block to virtqueue? Best, Wei