Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1914804pxu; Tue, 24 Nov 2020 11:58:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKv++Fz+Kd+BpubzjsadQduPeBvx163V0jjpvdxdzzyIbU3MFoiHmxSCREGwUsAJZ3RAWh X-Received: by 2002:a50:8562:: with SMTP id 89mr156799edr.144.1606247885760; Tue, 24 Nov 2020 11:58:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606247885; cv=none; d=google.com; s=arc-20160816; b=XOw6RdQ15PnEumNQOwkSLdaGD+6WoYwctx0iW3TTVvLh5cdrPWAVPuq/O/dBDcFG6P YLbNw8KWlEuh0vgAfKX9w7thgEokV7KKICfIGloPsDxB17VOu9Twwba0pCgf7z6FWU7u FrPv/2Pd6Ug1F+FZ9j3/b8u045prmbvmJHWnWKcArhrYtw38C0oVkM1Cxw3LKMAop4qu bDaxQbSItoq4lwwPfQ72/X7W/m5ivYWHvog5AVFQE4hEzzPaMsNAuH0Y382Fhe1BaGzv YV3GOH03zpfVaWxDn041qs0X5YllMTR+3T/AeAjn30nm3faYa5/Zt90vvs66PAfwR0m7 W4UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5SRGiXX4dxU6UG326yCVJi+Xa49zYVgh4TutwaobuZ0=; b=kqX+JfF6eGi4M1c65c3w6aPMM1/vRhuk0+3bvdzZcfYb/ZHmwVGoVSXf9VbivMGgTI FmvK9/7wpuy64KS+NKHwK71KRYJN4Epo6+sYBgnO59o8L/vftsaOEVE8jH/C/EfKHCSK oHjH3YHy03TyqAy2o0lhL0BeHFDSbcKbE541zTyNx2K7Jcb9WlhJi3db2EbUw4UNxYA7 xod6kysmsY/kpDB8+lF2wEhdKWeqeVZGhSLR4PcPqRqJUULzH5jIjsvK4cs0OWXOf0w5 WORx/JSwz5R8I9KyRtX3AuzNyejlo5VzaaQ/rqKiBiBsR5s9R0rgp81DESdjKgMMZorK 2r8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=SVplqW+T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si8646496ejb.548.2020.11.24.11.57.40; Tue, 24 Nov 2020 11:58:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=SVplqW+T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730413AbgKXIYg (ORCPT + 99 others); Tue, 24 Nov 2020 03:24:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:33504 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbgKXIYf (ORCPT ); Tue, 24 Nov 2020 03:24:35 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1606206274; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5SRGiXX4dxU6UG326yCVJi+Xa49zYVgh4TutwaobuZ0=; b=SVplqW+TiU0cTnmG6Ntf657Uk5Sw6JBrX7TI6Qnjta5Zl4MT6U/FzDecJ+tR8HlC20JFOp Ik3JmkeUjR0fPPXlhJMxRtBgJEBDTd3X0J5gTKIX46SL+4MyHP7HOIzDadFfYQOD8MnvHF 1I3j+gP/duMmAofSJ1vP6Q4uw70+uYE= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 00B36AC48; Tue, 24 Nov 2020 08:24:33 +0000 (UTC) Date: Tue, 24 Nov 2020 09:24:33 +0100 From: Michal Hocko To: Pavel Tatashin Cc: Vlastimil Babka , linux-mm , Andrew Morton , LKML , David Hildenbrand , Oscar Salvador , Dan Williams , Sasha Levin , Tyler Hicks , Joonsoo Kim , sthemmin@microsoft.com, John Hubbard Subject: Re: Pinning ZONE_MOVABLE pages Message-ID: <20201124082433.GT27488@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 23-11-20 11:31:59, Pavel Tatashin wrote: > > Makes sense, as this means no userspace change. > > > > > 2. Add an internal move_pages_zone() similar to move_pages() syscall > > > but instead of migrating to a different NUMA node, migrate pages from > > > ZONE_MOVABLE to another zone. > > > Call move_pages_zone() on demand prior to pinning pages from > > > vfio_pin_map_dma() for instance. > > > > As others already said, migrating away before the longterm pin should be > > the solution. IIRC it was one of the goals of long term pinning api > > proposed long time ago by Peter Ziljstra I think? The implementation > > that was merged relatively recently doesn't do that (yet?) for all > > movable pages, just CMA, but it could. > > From what I can tell, CMA is not solving exactly this problem. It > migrates pages from CMA before pinning, but it migrates them to > ZONE_MOVABLE. CMA suffers from a very similar problem. The existing solution is migrating out from the CMA region and it allows MOVABLE zones as well but that is merely an implementation detail and something that breaks movability on its own. So something to fix up, ideally for both cases. -- Michal Hocko SUSE Labs