Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp505718pxu; Fri, 4 Dec 2020 08:28:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWm50nZqXkRT1l7oQZ+C/3BBe2J02Z8jUuADBSi8YA0xigjXa2Vg7VyeGi81DfnaXOgv4L X-Received: by 2002:a17:906:2642:: with SMTP id i2mr7623869ejc.493.1607099302620; Fri, 04 Dec 2020 08:28:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607099302; cv=none; d=google.com; s=arc-20160816; b=XbcG49V7xCLJkSo9ZtSFGnNVT71zngnJHcwC7Xf4vRDY0KxYgfFDOfb+F6FA1NLozV PpdzBaI/KyAMKJ9aCi4mKIsmq9MfFi24ekQjMe/ExyKumRSiSjquNpoNw1osn89d72RQ VPoBt/EnGFItt9Ven2Zwoofsj2aJMWxsL+pfoTooGjqx58QmXBALEDts++6gJHAGr3bI uCwzUrISXgREEteNHtreeXc06uA89PCxZlhPuGtwo49iJ1ymKB+21jIl2mHEeaycGpa3 GBNaKgRRus7ZbvA85omx00TzzrkZ6itxOpyctuAlKn/I9Jolpj7Lc2wveOuajv2tvOzW rIBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RcTmsxVbOJXkWM5Hd5SB+R3sckednkoKgaMSdIRGnRE=; b=N7tkUt7Gnio/ENOqvnOOgd6uZ1+MthWpXUa5DjIoDh2NmOP+2cZ5FZ8ogwnXIWzYZ5 Qve8UwmtaWkHCCktV0mg6A1yEA7Bk7GAr2MEeMOVigfuv3G5/RCM74K5DfQskxMjGxL2 Kt0aY2ciUL1c2N30stPDk21zpZBzhnK7VLRzymoFmQSbQSDsAgvIV+QYipJAtWXZ1bTA dIydm7b870X2hMMyT9lkh9/lyE+bbndPY9gjMwEaiH/ngoxVn5+ro2tvzT0ViunfyczB wb/h4c80gSMTrVddSh0iOJyhfBlVcXDOubC5+n9nyOXHDKJSW0zVBFq9jTJPvnBU3BgL yWuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=BcNTUMTt; 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 y11si3753348edm.309.2020.12.04.08.27.59; Fri, 04 Dec 2020 08:28:22 -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=@soleen.com header.s=google header.b=BcNTUMTt; 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 S1728340AbgLDQ0O (ORCPT + 99 others); Fri, 4 Dec 2020 11:26:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727639AbgLDQ0N (ORCPT ); Fri, 4 Dec 2020 11:26:13 -0500 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 884DDC0613D1 for ; Fri, 4 Dec 2020 08:25:33 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id lt17so9536454ejb.3 for ; Fri, 04 Dec 2020 08:25:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RcTmsxVbOJXkWM5Hd5SB+R3sckednkoKgaMSdIRGnRE=; b=BcNTUMTtlQkxrPmb8zwbLGhYkGaL1vhWr2vSKVnV5wLvzJwwaI1BabmFIU88VcHUXP M6t4GH6Nr1FMOhQIMKR2x8CTrozIO4CbJ1z2EX3szggx4QAxb4NYfdm6woogfEitJ8kb M8vxO/HdApAQk7WajLexNjGmNkTeNiYGh1dee2+5Cjs5GA4Ecdtb1Ul06fa63h/MyE1g nq+zwU8QfUFUpTOYUw900hLOx6aURLnXhuceee2TZHEk3rXFEquI5n7WL7qo58pdvIFd NOADsGKMx0moo034Two+05D1x2sEL0SdZgQhlVJ/Jl6FR3qBUZQnmk25q/ub5YICUhfv jJBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RcTmsxVbOJXkWM5Hd5SB+R3sckednkoKgaMSdIRGnRE=; b=oM0TITRLcb0B+eTz3m+OqytqFBxxRUZK1d30Eu36tvWICILj5Ojtc2IAKuwsMKAJVk UJLdudQlrJLClW2OBAFkcFa/ozNaxPYr5mGNjF6RcVtTH8CPo29y1Hy2jbgZK8LGQh6F PxIFrE7N7LeT8GrbfXnQSTomVww5afeY8jS8VJLvC5EPCyOsaCTndE/pvvWhC5060R7M QDBjMhKb2iEaXmCnzZLH3P9kps/vsD4xYWVIPeCcDf4Ng24ayK0fiWfCIYNAOZGzWMP2 SDcokF36myY6qA5hxu1shRnZn0WkZNP6omKwh8rds9W8iWSWlamE3RzxoFYavzboU9uz GD3g== X-Gm-Message-State: AOAM530K5C/PRG0rI4Uc87h9n1c429dXkzPePevZHIQoZ3xwqWg51KHO 5CZ1d+OW7RUe2Ecj1A9BD4S5so6wNsgcffhYuRcL+Q== X-Received: by 2002:a17:906:fb9b:: with SMTP id lr27mr8076906ejb.175.1607099132312; Fri, 04 Dec 2020 08:25:32 -0800 (PST) MIME-Version: 1.0 References: <20201202052330.474592-7-pasha.tatashin@soleen.com> <20201202163507.GL5487@ziepe.ca> <20201203010809.GQ5487@ziepe.ca> <20201203141729.GS5487@ziepe.ca> <20201203165937.GU5487@ziepe.ca> <20201203193607.GV5487@ziepe.ca> In-Reply-To: <20201203193607.GV5487@ziepe.ca> From: Pavel Tatashin Date: Fri, 4 Dec 2020 11:24:56 -0500 Message-ID: Subject: Re: [PATCH 6/6] mm/gup: migrate pinned pages out of movable zone To: Jason Gunthorpe 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 3, 2020 at 2:36 PM Jason Gunthorpe wrote: > > 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 :| Not really a spin lock, the second thread won't be able to isolate this page, and will skip migration of this page. > > Jason