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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, 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 DB468C433E1 for ; Thu, 9 Jul 2020 15:48:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C0A320720 for ; Thu, 9 Jul 2020 15:48:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="fJdsoF0I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C0A320720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D14F6B0003; Thu, 9 Jul 2020 11:48:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 282396B0005; Thu, 9 Jul 2020 11:48:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1718A6B0006; Thu, 9 Jul 2020 11:48:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id F17D06B0003 for ; Thu, 9 Jul 2020 11:48:18 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 84D3F181AEF1E for ; Thu, 9 Jul 2020 15:48:18 +0000 (UTC) X-FDA: 77018969076.25.mass70_4b1784826ec6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 6932F1804E3B2 for ; Thu, 9 Jul 2020 15:48:18 +0000 (UTC) X-HE-Tag: mass70_4b1784826ec6 X-Filterd-Recvd-Size: 4957 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Jul 2020 15:48:17 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id b25so2944896ljp.6 for ; Thu, 09 Jul 2020 08:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/O6H63+iy27zC2H7F0ueImelp7Ge5SFqvQCCzIgdoPI=; b=fJdsoF0IE+FLEEv9KDqsmMTunmNA1t7ytAqxnRwXZCyUBjvHa+7Feup8NmXZt2RCIu wsgnS324bHVYR7X24SjoapJxe8mrX3K9+2PcjnHWf6rNZtlb7ZolU+tws3K1hH1KVmcm bycKsH6D+8Qh9cjGdW5CUIhYqPa2fotIWVcNMVaZzViZEam/5tBRnUOj9UJO1x+fIc3m O8cVqipLSngqj+FzKufF+G68podLoQIbSZLK6hhNLOGNV82XT9hOnl60iqcAl0Y9sW56 rQS8TUjYjEzWJepjjp1cqlqgBm1rgHT/O7QjaC3BjKm630xfivlUM+Jy9Sg0MDc3qNtn ucVQ== 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=/O6H63+iy27zC2H7F0ueImelp7Ge5SFqvQCCzIgdoPI=; b=j9sYOnzLUmhWKD90vAHgFxlt49u1viRWGtVdDYIjKL5sApI2fSBSuSIHkNxWzlrBJq WtgVu8VoYGeIYKjn9HFI8zY9ENTAsvx3WONneindvkCf5MC3AOBSONDco7ewCU/ASmGl sf0I2UIkvuEqpqs7EJZWhlNGkXGwirJlHJjEpFwv0/eXj6hFsY0Py5C29yQu9L4STYvg h57UqCgsQUMK83rfpYAzzZ4kbSz1KUs9dOLTeCXKw3kA0eJYVi3M/1ZKH58eq+JHott4 Fx2EzNM6Y+F3Sy+p4qFE/9rV2DXiUB+9cbl9VaQiQEY+/nNYo5q8Ga1YQqARsNMZv8TL 4roA== X-Gm-Message-State: AOAM532nFZ/HFTvhzew/RLCzJa2/AcrUxShkvKMGhLbmoYlnimE8Y9Fr yJQpQJ7Yu2nqyFuKNe2vRu9HUw== X-Google-Smtp-Source: ABdhPJwXJuJPmi0hCIRXh7hOH2stPsHaUlbTEb3sv+IZgUbomityN8CqxmAJv3P/iYDzqj1wj1dh5A== X-Received: by 2002:a2e:9144:: with SMTP id q4mr21400278ljg.84.1594309696184; Thu, 09 Jul 2020 08:48:16 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id 83sm1055834lfk.84.2020.07.09.08.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 08:48:15 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 8F36210222B; Thu, 9 Jul 2020 18:48:16 +0300 (+03) Date: Thu, 9 Jul 2020 18:48:16 +0300 From: "Kirill A. Shutemov" To: Hugh Dickins Cc: Matthew Wilcox , Alex Shi , Johannes Weiner , akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, 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 Subject: Re: [PATCH v14 07/20] mm/thp: narrow lru locking Message-ID: <20200709154816.wieg5thfejyv2h2l@box> References: <1593752873-4493-1-git-send-email-alex.shi@linux.alibaba.com> <1593752873-4493-8-git-send-email-alex.shi@linux.alibaba.com> <124eeef1-ff2b-609e-3bf6-a118100c3f2a@linux.alibaba.com> <20200706113513.GY25523@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 6932F1804E3B2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 Mon, Jul 06, 2020 at 09:52:34PM -0700, Hugh Dickins wrote: > On Mon, 6 Jul 2020, Matthew Wilcox wrote: > > On Mon, Jul 06, 2020 at 05:15:09PM +0800, Alex Shi wrote: > > > Hi Kirill & Johannes & Matthew, > > Adding Kirill, who was in patch's Cc list but not mail's Cc list. > > I asked Alex to direct this one particularly to Kirill and Johannes > and Matthew because (and I regret that the commit message still does > not make this at all clear) this patch changes the lock ordering: > which for years has been lru_lock outside memcg move_lock outside > i_pages lock, but here inverted to lru_lock inside i_pages lock. > > I don't see a strong reason to have them one way round or the other, > and think Alex is right that they can safely be reversed here: but > he doesn't actually give any reason for doing so (if cleanup, then > I think the cleanup should have been taken further), and no reason > for doing so as part of this series. I've looked around and changing order of lru_lock wrt. i_pages lock seems safe. I don't have much experience with memcg move_lock. Alex, if you are going ahead with the patch, please document the locking order. We have some locking orders listed at the beginning of filemap.c and rmap.c. local_irq_disable() also deserves a comment. -- Kirill A. Shutemov