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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 11AECC2D0A3 for ; Thu, 29 Oct 2020 14:02:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47FC6207BC for ; Thu, 29 Oct 2020 14:02:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="rSU47uiN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47FC6207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7E25C6B006C; Thu, 29 Oct 2020 10:02:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 794856B0071; Thu, 29 Oct 2020 10:02:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6AAA86B0072; Thu, 29 Oct 2020 10:02:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 3FBFC6B006C for ; Thu, 29 Oct 2020 10:02:10 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D31A01EE6 for ; Thu, 29 Oct 2020 14:02:09 +0000 (UTC) X-FDA: 77425127178.17.humor31_0e0435e2728e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 8C0DB180D0783 for ; Thu, 29 Oct 2020 14:02:07 +0000 (UTC) X-HE-Tag: humor31_0e0435e2728e X-Filterd-Recvd-Size: 4720 Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Thu, 29 Oct 2020 14:02:05 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id z5so3548920iob.1 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=sJF3tcLprPly2x4six6DA90rKxwVYdCQCMmz4S3I6LuMcxRQ7qPT2vZAlUOtbuAl9D 5aLgRcgZ6oWg+dypVecAEzc9vCyHReIwKG8rJ+Vfw7GKwhrXdeV7xDjdXNI7ttQoor9j PbNNIYXzpit/tWATVPQRC2x9HpqZJyIEpV2/iuLcZ1beP9NDgTg7BLVt9PL74xwYn8ns b/bi7Y+k81aO99LY17ZiQCY51eVy2c2qLduBHdckPXQYTotRmS+IKXeE5BjyQu/yEG0e MLK5jh2+BSs8142laqMGfJCDGLoSkOH1rZaW70BLLs4Ef+zjqml4hVHi+URfsBuo4O/g V4kg== X-Gm-Message-State: AOAM533CroNDZMgrYuLp3CdiN0ZAzSBfXHLPkauMpclAHwa4+YaEuoNA 8rdpWocxmNs9GRfGk86f4fRwRQ== X-Google-Smtp-Source: ABdhPJya/H8X75lH17Bg09izCpK/ATiN2lerZxEU0QS+HfbvG2/ezU47Y8rna+vH9/OZd1gnxxAOMw== 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 In-Reply-To: <1603968305-8026-6-git-send-email-alex.shi@linux.alibaba.com> Content-Transfer-Encoding: quoted-printable 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, Oct 29, 2020 at 06:44:50PM +0800, Alex Shi wrote: > Simplify lru_add_page_tail(), there are actually only two cases possibl= e: > split_huge_page_to_list(), with list supplied and head isolated from lr= u > 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()= . >=20 > So decide between the two cases by "list", but add VM_WARN_ON()s to > verify that they match our lru expectations. >=20 > [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=E4 > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org Acked-by: Johannes Weiner