Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2612967ybl; Mon, 20 Jan 2020 06:15:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyqWZ6DlRmRH9+wsNf8Ab3Pr5gZykeJ4IIiRPiw0Xrba7Q/oB00op/ubT6vSaLlzi+qBOey X-Received: by 2002:aca:b1d4:: with SMTP id a203mr12667434oif.150.1579529744323; Mon, 20 Jan 2020 06:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579529744; cv=none; d=google.com; s=arc-20160816; b=GYJNjizdfsDiNsRding5rNG8I6qz6R+yDDb9fXWE5FrgzqjXz1BbSELkQqsM8mp8Mr o2AosBJjxzlC7sJRLrU2i6JxhZZM95bdSra15xiUL1MUlKcvlaC98UKsy1DWiIry+iPI WQLqmRqwkMy6L9S7TvBzCY74fGWD/iwlZw7E1CVNrlJ3qtGjG5MuUA8alyE4Zu2nAnkY F/qsMuk0p9jg9R6utQDVDGA04LnTdYuMHsMFrpPKpj6mrUwU7cqZda8YqagMqbFZcjNG nDZ/X6Jmy0tOL0bpznNBpJWgk3Fue3Iw8ZOpigtGPONZYfwFLp/Pd+rYx+00OeACdfBt FjCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lkDkkMY1TWgj8+gYQdlaFHI7hmmwbXGQtowlL27ZgDI=; b=mzaQFuW8OJPunR2HRQij1ZT9pDQtf8QbKYaPogrA2oXoX7kegu70/9rawHOfxSHkYE WxeGhu68x+3AsHxYnS9wmrqtyJ+u6AqPtddr0TwjrTgtOD2oioGZIpDF6uep7TXDsPay IwkUf68HsagL0bBeDZIlE+9WYqsfV7MHYek4bJK2nxQRiY71SZHP0Vjx4dCcLL5rHMnh 0Iy9taTAVRjB+WQtIZsymyfckVl1rBmV0XOplq1GymetvFyVs+jEuEYI98kWRO1dYMuQ B/ZLaEem/058mmvRE6LODIGi+PL1pB47XQ94gWI3Ud5fSWNcEya1jszo/PKwzmoDol36 WIiA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q124si18278582oig.228.2020.01.20.06.15.32; Mon, 20 Jan 2020 06:15:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727692AbgATOOh (ORCPT + 99 others); Mon, 20 Jan 2020 09:14:37 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33573 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbgATOOh (ORCPT ); Mon, 20 Jan 2020 09:14:37 -0500 Received: by mail-wr1-f68.google.com with SMTP id b6so29780839wrq.0; Mon, 20 Jan 2020 06:14:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lkDkkMY1TWgj8+gYQdlaFHI7hmmwbXGQtowlL27ZgDI=; b=Nrwv0yvJTzzbJuT58voYmYgzfFlF6wgNA1P1HpK4Wa7NYjd99eYag5WD5bIe42UT7k 5bOvEdiYDUe7VPyjlItS0Vuj/bwNhmuJL1knyX6Y+TuL+2wug5MhpQC03u7mNyjIsgSn uc11evw/04AG/X1tXK3b9QR9SIbLt40YGzM9Q6gPsRxSO3GvcGuU/hvWZfZwSTYuFEx/ xcemiqpoEWtsPWdGRqKulOHzW6cEYZOsdz4e2rCq1ViBYOSenHztVtTNjDhuSG/M/cWJ sz25dAGte6G1pTCpp6UVm86i3a2LW/FBuORepe0wxn98hxQRdNAtkp+980kHo25L9RTl Rk7g== X-Gm-Message-State: APjAAAUmjeigQJ9k1+uwiOo0NPzOj6+GSGNzTsJfRbKAOYfkCosTbdDA edoeL3HOXRLgY9M3j+uEr2Y= X-Received: by 2002:adf:fd43:: with SMTP id h3mr18440651wrs.169.1579529675281; Mon, 20 Jan 2020 06:14:35 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id i11sm49089379wrs.10.2020.01.20.06.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 06:14:34 -0800 (PST) Date: Mon, 20 Jan 2020 15:14:33 +0100 From: Michal Hocko To: Tianyu Lan Cc: David Hildenbrand , "lantianyu1986@gmail.com" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "sashal@kernel.org" , "akpm@linux-foundation.org" , Michael Kelley , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , vkuznets , "eric.devolder@oracle.com" , "vbabka@suse.cz" , "osalvador@suse.de" , Pasha Tatashin , "rppt@linux.ibm.com" Subject: Re: [EXTERNAL] Re: [RFC PATCH V2 2/10] mm: expose is_mem_section_removable() symbol Message-ID: <20200120141433.GI18451@dhcp22.suse.cz> References: <20200107130950.2983-1-Tianyu.Lan@microsoft.com> <20200107130950.2983-3-Tianyu.Lan@microsoft.com> <20200107133623.GJ32178@dhcp22.suse.cz> <99a6db0c-6d73-d982-58b3-7a0172748ae4@redhat.com> <20200114095057.GK19428@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 17-01-20 16:35:03, Tianyu Lan wrote: [...] > > Could you describe your usecase in more details please? > > Hyper-V sends hot-remove request message which just contains requested > page number but not provide detail range. So Hyper-V driver needs to search > suitable memory block in system memory to return back to host if there is no > memory hot-add before. So I used the is_mem_section_removable() do such check. As David described, you would be much better of by using alloc_contig_range to find a memory that would be suitable for hotremoving without any races. -- Michal Hocko SUSE Labs