Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp750956pxu; Thu, 3 Dec 2020 11:39:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6N9vnAtK1lGgU1SXdy9UFGoVDcair8CA0hcBl4aKtfDKiXjcAXvkATdhbrPYe0BmjYUzg X-Received: by 2002:a50:8f64:: with SMTP id 91mr4368713edy.310.1607024376768; Thu, 03 Dec 2020 11:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607024376; cv=none; d=google.com; s=arc-20160816; b=X+lLXh028xeD2ElRrD14Slv4djCCqGhS8cUh7ZW/+9wIPmIgPBmjeOOueb6yNAtURD dZgPGeZF9msxuzdPLHs2h77TjPlcJKtZhQhJ72Z8ob3T+uujaQFYelDwjXd1PSKX7vMs 0NQZ+ljg9EXsXuefPmQrgG7WkCcM5L8eNnFNTW80DUPvwcF9B4XAAKP0NVsyMtn5dd5g jk9M3Vhcw+hPiInbb2n91cWTqEzk5Mu4/c01+ZoMJTuCIdnHHnnP3qddmgUBkt50DV0L iEkqyiiqOpSqMs/GSkSNbvSRQB3mdR0sU8soWxpPitl7COtrZtn5hRfAoESYv8RKGXYC QDOw== 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=RqhxuUAWxbYZSw8sYvp2fumpu+s+7MnPGjbntXrF3WA=; b=SDKED9HEezeLkrkTE1ro+8UNcySUuvLtdhoz2RMxut7BXCiREOJ1fosuDAGWaLVsO2 z1T8MQW18HO5B7H0L1v2IK/yRqPnbYnlcM2syYEnbgPf8yzYCFywJofgxAMI3J0kCTcx sHbAeoEuC+mIihdjIvksEa/gdlKF1qLcTVJvNWZJ3a6/HoMEhOF2GQlgmM+FlvkiWViU TZl9sHyApcl557Fws/rig3XcFrvtnds6NpS1/HTKUqy+rCNftvBDqFgjKOch3yxFDTOk KLn9C8qArN7CZ4oFH7EDgL4V3bHiIlyg91UmMWqnCoQbBu0m7iOE2N50WOg64a2Z0imt 8kow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=RCQTki4X; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m64si1473803ede.159.2020.12.03.11.39.11; Thu, 03 Dec 2020 11:39:36 -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=@ziepe.ca header.s=google header.b=RCQTki4X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726885AbgLCTgu (ORCPT + 99 others); Thu, 3 Dec 2020 14:36:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbgLCTgu (ORCPT ); Thu, 3 Dec 2020 14:36:50 -0500 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2747BC061A4E for ; Thu, 3 Dec 2020 11:36:10 -0800 (PST) Received: by mail-qk1-x742.google.com with SMTP id d9so3241620qke.8 for ; Thu, 03 Dec 2020 11:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RqhxuUAWxbYZSw8sYvp2fumpu+s+7MnPGjbntXrF3WA=; b=RCQTki4Xd/Qb3GhbSR3sRvVmqBu3csotRQTOzEzSjm0eAbpCbHLcAb0W4Grb18P0fK sgbmvGrtwfFysooQrR98bzsGP5sWlv6PrlWpqaj9i9LMkj8Z3lU1nxVPM30XzuMiVSd3 3bw8WWEKYrpFSDZ3B6lTSSAeACAp5g/Pdj8ge6CM3D5f1gDCOk7EuzjwMG46vw+QWpXe W+IfQJ/glGKWr6U7ldsLd+TJP4UTgslRJHxv43mW2J4ap9brurs73Gr+bTNpD5ZzoOWP qS540QDpKslxcBKsVx9uq1R0L/0IX8NsXrniI08BKPSqkwue/Or5PXrOPZfVyYlZspkb HUkw== 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; bh=RqhxuUAWxbYZSw8sYvp2fumpu+s+7MnPGjbntXrF3WA=; b=Azwq8LoumxsYLx/dnrrIKph9KEpE6TPpH5yHtMc/Sf7fo/n7BtkOzzMjC/+p9CZIY7 0KuG7szyy3dokNnRTbib9opjOSR9WbAnNMUTwtX+NwlOWHAXhArMgkqKNCFXFPxI4PE9 lNOdkSF4PbzbQoobEYd0EjUU6U+Y+GjQ2Bn4kK2Gsb8r+EfWwpnxuh7TPJ/deQ1mWH73 FMyEl3hVwwd9YUKYqG3mDIJTY8EWeMoD0nv0cG8VbYrAkRSvChiwkNuZXk360K6U2FVM ta6XrNzITIHFbXW/p9QX1zTmi/srbVFS6xhapMxDz/0rST20ienKsQh3XBYi3OdeuefH k8PA== X-Gm-Message-State: AOAM533ZFhy2xRnzyBT3/AJncarWKcbkOxWpSx3jpOO6d57I/x+G0hzz 6ZtV6x8BVAMZPy1/wX6DsupAwQ== X-Received: by 2002:a37:9205:: with SMTP id u5mr4740419qkd.345.1607024169296; Thu, 03 Dec 2020 11:36:09 -0800 (PST) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id u72sm2616337qka.15.2020.12.03.11.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 11:36:08 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kkuOd-005bGF-BE; Thu, 03 Dec 2020 15:36:07 -0400 Date: Thu, 3 Dec 2020 15:36:07 -0400 From: Jason Gunthorpe To: Pavel Tatashin Cc: LKML , linux-mm , Andrew Morton , Vlastimil Babka , Michal Hocko , David Hildenbrand , Oscar Salvador , Dan Williams , Sasha Levin , Tyler Hicks , Joonsoo Kim , mike.kravetz@oracle.com, Steven Rostedt , Ingo Molnar , Peter Zijlstra , Mel Gorman , Matthew Wilcox , David Rientjes , John Hubbard Subject: Re: [PATCH 6/6] mm/gup: migrate pinned pages out of movable zone Message-ID: <20201203193607.GV5487@ziepe.ca> References: <20201202052330.474592-7-pasha.tatashin@soleen.com> <20201202163507.GL5487@ziepe.ca> <20201203010809.GQ5487@ziepe.ca> <20201203141729.GS5487@ziepe.ca> <20201203165937.GU5487@ziepe.ca> 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 Thu, Dec 03, 2020 at 02:15:36PM -0500, Pavel Tatashin wrote: > I studied some more, and I think this is not a race: > list_add_tail(&head->lru, &cma_page_list) is called only when > isolate_lru_page(head) succeeds. > isolate_lru_page(head) succeeds only when PageLRU(head) is true. > However, in this function we also clear LRU flag before returning > success. > This means, that if we race with another thread, the other thread > won't get to unprotected list_add_tail(&head->lru, &cma_page_list) > until head is is back on LRU list. Oh interesting, I totally didn't see how that LRU stuff is working. So.. this creates a ridiculously expensive spin lock? Not broken, but yikes :| Jason