Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp474909pxx; Thu, 29 Oct 2020 07:05:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW/TfzCWwWduLXpHzCKJTAz88p375PQ9wV700GEX4m3N0+AP04ghETfE8ZgwhOm+tU7w04 X-Received: by 2002:a05:6402:2d7:: with SMTP id b23mr4017535edx.196.1603980325258; Thu, 29 Oct 2020 07:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603980325; cv=none; d=google.com; s=arc-20160816; b=OoxEVjdWd7UwzuXiuVNJx5EuUCY0gshAkqJhiz9IiozRWObsoGmtrYtm4qmrkMGKCi laJl3YpsQF3/MfFGmqSurIPafUEQS9TzCW3NLyh+TPbUbrVHFNMkxySUkkd2bfWfdXkg jQDGHhNg9itkpOn1dcKTN7DkCUbJK7y2fWsXohd4QenuOuGTgH42hr1QcqtzKXv3M+05 IQCiqXUV0K8eLtZ4gdh8Va0O7irbVFo5wqU3LSTmWJ1QVLsPQOWUcRY53VFa44r6+PU3 mtbvtV5v1Qc53pL3YUTrGuaupWaTIOSuzmtwDZ9S5TA8JI6zCG/k458KSyImUomA9/md /RcQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7lEvOV/HbcXu0PIxvGw2SLLt11jclvnvIAXpPg76WxU=; b=SUpivD5rmOGKlxXlsG+YHne0eWZR7tGL8jRKF+DmYs2cf6v0zK3d7W+BwtM7IYmjl9 lGayeMpM0m8ae/FRRWy5tibkBQD/R/z+bbPa7LHSk9vSi/KaMFLRO5+Ip4KX3G+CotV+ ABlm2svSkj7t94K0NHfopYBWDESvp12+r2/eMdSwvjAJC7kpCnDHGCqhWIYPZvioDOXa Wvg2nCkd1zyXe9zhBvtBgTWjY4KfesR334Z4pts/cQ32xBqMDl/yeJADC0mjmp8FFDfA qSqvZqbum2bShuxEczY5xKRlcKISQo3mP77gFTu6aJhVYK532CpwWdvXwoAa9JiRCq/h fuMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rSU47uiN; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si2003205edq.428.2020.10.29.07.05.01; Thu, 29 Oct 2020 07:05:25 -0700 (PDT) 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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rSU47uiN; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727381AbgJ2ODT (ORCPT + 99 others); Thu, 29 Oct 2020 10:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgJ2OCe (ORCPT ); Thu, 29 Oct 2020 10:02:34 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC82BC0613D5 for ; Thu, 29 Oct 2020 07:02:05 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id k6so3540798ior.2 for ; Thu, 29 Oct 2020 07:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=7lEvOV/HbcXu0PIxvGw2SLLt11jclvnvIAXpPg76WxU=; b=rSU47uiN+XY2DRlhPzcq7v3YHqplBYOB704H2vL/6EQS4gR1nu2YF0tQlpFXM42713 yrahp6CxpAQIS8TroyeGlfDKA/pr43mbGZP9oDd5M6l+D/oAqhYPBYXjXrrENK692Arp bnWtQ6za577s/l7Q5EnfMS5ZqHUJGgec+jX1GHu3KXuVe1wF/TUg56hZvEjzlMznn7yp +TQXPOZExcoFGZSHf/DmCHrgf2QoYaQ3XEQMunoriLbnJydl+ePxI2MHyRETfRoOiRxn /iWEftMTCrfnResNfZnGKtPARBxXPEMrQdrejIfFHSnF9dGNMJF33nSuTu+G4qLqSscq udoA== 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:content-transfer-encoding :in-reply-to; bh=7lEvOV/HbcXu0PIxvGw2SLLt11jclvnvIAXpPg76WxU=; b=ufQRHR7A/MbGxdwbg6P/yP/wxD43kLh6nvVtSPG4fIY4gZwIVVcpQuqLQqG13AGtMr JQK5zkLCDuzZlC9QxsIr3ublErtsWWHUzwTQJXjH8gPIHmGg2iYKKRT6IfJjso+yJ6Eh Bchg9tpKU/G+WS0371CY8MSGIPPznv1mUJzjl+TU06nayvRlLoMs5Duyi62PiRN7SQge 93VwUiaFFGttJYftTalDbi5zifk+9+zmry4Ijo66tlWTzMekIJ+3P1JTV3/U34cH48yi P+lyaqJQQHBllgxKj88vm4TXwi6bK8R29c60kNAqXzOvK/JiUv1KuW5OOvRrfmwdTLu8 cy+A== X-Gm-Message-State: AOAM530ECqwNOOMlpraUS42tzxQlpLNWCi8q94n82wDi9BZp1e6niFwc BOdz8P933NY1Cs4qqWt7JGBinQ== X-Received: by 2002:a02:c952:: with SMTP id u18mr3567152jao.139.1603980124869; Thu, 29 Oct 2020 07:02:04 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:536c]) by smtp.gmail.com with ESMTPSA id l4sm2128970ioj.41.2020.10.29.07.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 07:02:03 -0700 (PDT) Date: Thu, 29 Oct 2020 10:00:20 -0400 From: Johannes Weiner To: Alex Shi Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, willy@infradead.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, mhocko@suse.com, vdavydov.dev@gmail.com, shy828301@gmail.com, Mika =?iso-8859-1?Q?Penttil=E4?= Subject: Re: [PATCH v20 05/20] mm/thp: Simplify lru_add_page_tail() Message-ID: <20201029140020.GF599825@cmpxchg.org> References: <1603968305-8026-1-git-send-email-alex.shi@linux.alibaba.com> <1603968305-8026-6-git-send-email-alex.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1603968305-8026-6-git-send-email-alex.shi@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 29, 2020 at 06:44:50PM +0800, Alex Shi wrote: > Simplify lru_add_page_tail(), there are actually only two cases possible: > split_huge_page_to_list(), with list supplied and head isolated from lru > by its caller; or split_huge_page(), with NULL list and head on lru - > because when head is racily isolated from lru, the isolator's reference > will stop the split from getting any further than its page_ref_freeze(). > > So decide between the two cases by "list", but add VM_WARN_ON()s to > verify that they match our lru expectations. > > [Hugh Dickins: rewrite commit log] > Signed-off-by: Alex Shi > Reviewed-by: Kirill A. Shutemov > Acked-by: Hugh Dickins > Cc: Kirill A. Shutemov > Cc: Andrew Morton > Cc: Johannes Weiner > Cc: Matthew Wilcox > Cc: Hugh Dickins > Cc: Mika Penttil? > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org Acked-by: Johannes Weiner