Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp442536pxk; Wed, 9 Sep 2020 09:17:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwifIEDsOoQqQfaxsxUB9hdH75QqbCtkpRmBADHbm3EXX0XdOKtvFTWrjKxAghmpyCZtgGE X-Received: by 2002:a17:906:71c9:: with SMTP id i9mr4315393ejk.250.1599668242355; Wed, 09 Sep 2020 09:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599668242; cv=none; d=google.com; s=arc-20160816; b=GU0UCsyLBAHpEF0HT6tcnwpUmNGQI8sL559BKOuKVT8JJiyy80bdDX8WRdogf6CtF9 Dpa+WSSOKaN2ZW+LBsAh7C7DpxboKQiX17bO2kORmqOtEQuqAGhRJ0RBsqg7TaIFvLf4 shVGrm89qyDurpG1yAoXt4fWx6tidlxYEt9+YEu38ZsBVyL8nfSxJLcve6/TqqqD7j+M SrKSUtBD7pyWGGe6ZWeVpLtMT5KpZ5Yt1zgGYAhxxiwPK0m7c18DFTycAyUyY87nVZXL ArJqI1Plg3EJtVSFGi/hIMILGMzKOWEWGg4ktmCbVDCOQcvVU14bYKKW7UGkJA+TdAaU n+Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fi6EPOk4V99JFbqYmEhNPN5TNg8BdROS9o2xQ3RBg5E=; b=yQMp9JT70dXjD+0VvAmnnKKJmly1syn08sEWRtsRKUzZNNcBj+pfc/XyPrsZz88AKk OBEbpvrASetqGDrhWUmGLyqS4cfMdYRo8dP1gfOmi6tJYKp7r4g15vkRXldNR20LCZa0 9XD0W87fXyETW3MvogmL5f2V0hGQjuRfdIhxaFGJjK4c1Gl73fuNuzMRMWRNpSb6cpBY l6361SqvRRAjLdnGQ1qWaoytsKsrFwrEhjFd6K58W2Ekk4eGHfZsrdB110sWh9w4fW42 2GsBIoYS5PBNlCenvu07XJAblBtFWltsH45f6WL8QXwo/LUO6kSGRqFw1jkCDNl+w/BQ 8k2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rlfBLzoK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci4si1693580ejc.612.2020.09.09.09.16.59; Wed, 09 Sep 2020 09:17:22 -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=@gmail.com header.s=20161025 header.b=rlfBLzoK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730712AbgIIQP0 (ORCPT + 99 others); Wed, 9 Sep 2020 12:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730576AbgIIQLl (ORCPT ); Wed, 9 Sep 2020 12:11:41 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56ED3C061756; Wed, 9 Sep 2020 09:11:40 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id t16so2820126ilf.13; Wed, 09 Sep 2020 09:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fi6EPOk4V99JFbqYmEhNPN5TNg8BdROS9o2xQ3RBg5E=; b=rlfBLzoK50AdGuXYFUe5sFCgGZuO8AeB+DJLXTpOd98w2tONPNvWw7PRN8UwfX1kcB qpaUWzVXxXFCR4QS6X1eKPXKlVCOw84PnHMfRJcwucgm7MCtrONclkv3c2KGz6NKRWF6 bIpuGEl92zf3lDES3mrCY0o9yN5bbmlesde/nSjHgaz11aqQZJE94l16lobir7khJp1G cAcR6z9rG4oAj+dPwZ9HPfHvbwf3BM1FGFuYK/NIxWfxS1rSM4FBiuz2BiSu5KXeaOPw QTce2zDZfvrieGVGSjHvcdTXGqtBQ81gE7ZOjeMSmma7RQZoOn1sEkpUSmqsZ5lAvgfp /a4A== 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=fi6EPOk4V99JFbqYmEhNPN5TNg8BdROS9o2xQ3RBg5E=; b=qJha6f4gmbSWYnm3pGMA6D5vLY6ARzjyxho3VTsLMjBB/cTxAtHxTt94z8Aoa+r5xE EWpB1yVgcPRfJoAy9OD8AfSKjtSZVpG4/+TEplEuCjhedRNFCRDWSymyo8b8qvKZCZTL jrw3/FM1+i9EGAcnFdXFtRyir26nDvRCPWImbaGfJN/vcyM9QQm6INroR9lLzetFSvSK u4XhOKZEwVJp3VAnEkn2CIVldc2MXdTk0oCCSjSHLLgojnkQsmWSq2WBlAxQJ+pdOjgB fzVKx3+seybPo0VHEOcW01GkOfJmc/G1C754Qb9KKbvNskgtlfQcYyQsRgRkE89rR+Q0 GbUQ== X-Gm-Message-State: AOAM5321nXgtgmyU/XSM+cjnc5QIBRQkFic+sZNGwaw4A+QIhdbi+DdM Di3dKc9UoZfhuVY0iZciEBhYXP4U67TKgyaDnY0= X-Received: by 2002:a92:ae06:: with SMTP id s6mr4063803ilh.64.1599667899575; Wed, 09 Sep 2020 09:11:39 -0700 (PDT) MIME-Version: 1.0 References: <1598273705-69124-1-git-send-email-alex.shi@linux.alibaba.com> <20200824114204.cc796ca182db95809dd70a47@linux-foundation.org> In-Reply-To: From: Alexander Duyck Date: Wed, 9 Sep 2020 09:11:28 -0700 Message-ID: Subject: Re: [PATCH v18 00/32] per memcg lru_lock: reviews To: Hugh Dickins Cc: Alex Shi , Andrew Morton , Mel Gorman , Tejun Heo , Konstantin Khlebnikov , Daniel Jordan , Matthew Wilcox , Johannes Weiner , kbuild test robot , linux-mm , LKML , cgroups@vger.kernel.org, Shakeel Butt , Joonsoo Kim , Wei Yang , "Kirill A. Shutemov" , Rong Chen , Michal Hocko , Vladimir Davydov , shy828301@gmail.com, Vlastimil Babka , Minchan Kim , Qian Cai Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 8, 2020 at 4:41 PM Hugh Dickins wrote: > > [PATCH v18 28/32] mm/compaction: Drop locked from isolate_migratepages_block > Most of this consists of replacing "locked" by "lruvec", which is good: > but please fold those changes back into 20/32 (or would it be 17/32? > I've not yet looked into the relationship between those two), so we > can then see more clearly what change this 28/32 (will need renaming!) > actually makes, to use lruvec_holds_page_lru_lock(). That may be a > good change, but it's mixed up with the "locked"->"lruvec" at present, > and I think you could have just used lruvec for locked all along > (but of course there's a place where you'll need new_lruvec too). I am good with my patch being folded in. No need to keep it separate. > [PATCH v18 29/32] mm: Identify compound pages sooner in isolate_migratepages_block > NAK. I agree that isolate_migratepages_block() looks nicer this way, but > take a look at prep_new_page() in mm/page_alloc.c: post_alloc_hook() is > where set_page_refcounted() changes page->_refcount from 0 to 1, allowing > a racing get_page_unless_zero() to succeed; then later prep_compound_page() > is where PageHead and PageTails get set. So there's a small race window in > which this patch could deliver a compound page when it should not. So the main motivation for the patch was to avoid the case where we are having to reset the LRU flag. One question I would have is what if we swapped the code block with the __isolate_lru_page_prepare section? WIth that we would be taking a reference on the page, then verifying the LRU flag is set, and then testing for compound page flag bit. Would doing that close the race window since the LRU flag being set should indicate that the allocation has already been completed has it not? > [PATCH v18 30/32] mm: Drop use of test_and_set_skip in favor of just setting skip > I haven't looked at this yet (but recall that per-memcg lru_lock can > change the point at which compaction should skip a contended lock: IIRC > the current kernel needs nothing extra, whereas some earlier kernels did > need extra; but when I look at 30/32, may find these remarks irrelevant). > > [PATCH v18 31/32] mm: Add explicit page decrement in exception path for isolate_lru_pages > The title of this patch is definitely wrong: there was an explicit page > decrement there before (put_page), now it's wrapping it up inside a > WARN_ON(). We usually prefer to avoid doing functional operations > inside WARN/BUGs, but I think I'll overlook that - anyone else worried? > The comment is certainly better than what was there before: yes, this > warning reflects the difficulty we have in thinking about the > TestClearPageLRU protocol: which I'm still not sold on, but > agree we should proceed with. With a change in title, perhaps > "mm: add warning where TestClearPageLRU failed on freeable page"? > Acked-by: Hugh Dickins I can update that and resubmit it if needed. I know there were also some suggestions from Matthew.