From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30191C433FE for ; Thu, 3 Dec 2020 19:36:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 83A2F221ED for ; Thu, 3 Dec 2020 19:36:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83A2F221ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3FC6F6B0068; Thu, 3 Dec 2020 14:36:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3ACF96B006C; Thu, 3 Dec 2020 14:36:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29BF78D0001; Thu, 3 Dec 2020 14:36:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 0DD8E6B0068 for ; Thu, 3 Dec 2020 14:36:11 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C8B3E181AEF23 for ; Thu, 3 Dec 2020 19:36:10 +0000 (UTC) X-FDA: 77552976900.18.snake42_4503726273be Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 8BA30100ED3DA for ; Thu, 3 Dec 2020 19:36:10 +0000 (UTC) X-HE-Tag: snake42_4503726273be X-Filterd-Recvd-Size: 4867 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Dec 2020 19:36:09 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id q22so3264065qkq.6 for ; Thu, 03 Dec 2020 11:36:09 -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=Fa4OUZjBT+hArnhqdnI4TyS2VIFrt5t0siOSKPPSu0ibcYDqEngOWvCAG8T3XL2eHb E42FiFY2XgH3RNht0ESx6WTIgxRaXyau3VpGLLQ1Hhr9oqb/vlnJWqveRQFxz8rMN1ar hCF4FEpgcSX4PsYhFbGukDXWFuGVQijFGoWqyjQ54U+Es0jSInqAdzCVTCFktNUStTvS E92XDOxyqwCKrlbiuGpOut3P93ex7d8aGVOTbitOic1YN9c6Yn3cmPL22bfuPgJzgoHx fVIUiKuY2WgkYfmBASDynMYOyet9ZwzPobkg7urp6em+ciY4htq5+k+fTh4CUE21RStV iYmg== X-Gm-Message-State: AOAM531e8I0LImOyfZ/4S7ZyVczandrtX+KOBUNCE7zuH9dltxTxkSBw RN+Km0ylPat3Z8rIEOmqs6Jr7g== X-Google-Smtp-Source: ABdhPJzTw30UYowxVAv1La2ggQqZSxEIvOi/C1vjSqqYMtGmE+HeZjSfg3f2X2E1jyKyjfUJvbmdEw== 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: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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