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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B10F7C33CB1 for ; Tue, 14 Jan 2020 09:31:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0989A207FF for ; Tue, 14 Jan 2020 09:31:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0989A207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 836FA8E0007; Tue, 14 Jan 2020 04:31:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E6EF8E0003; Tue, 14 Jan 2020 04:31:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D66E8E0007; Tue, 14 Jan 2020 04:31:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 57C7D8E0003 for ; Tue, 14 Jan 2020 04:31:25 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 1F95F181AC9B6 for ; Tue, 14 Jan 2020 09:31:25 +0000 (UTC) X-FDA: 76375721730.11.queen31_296d9c2a10b29 X-HE-Tag: queen31_296d9c2a10b29 X-Filterd-Recvd-Size: 3665 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jan 2020 09:31:24 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id p17so12856846wma.1 for ; Tue, 14 Jan 2020 01:31:24 -0800 (PST) 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:user-agent; bh=QU2E8oF5JNAbYAlglR/3BSATG0M/9oeZpEn5cOfx658=; b=TquMuaM2VMgs21Pq9Ud6fDjIxiBs3Pw69ftvt/CgFfpz2zyUUfu9037iA/QncNKykj bDl3kRKYRSL0uhU1p31dpxkLJpRcVr8b/9R1kQ/r4RuhmD3d7yFPyQo4yIuxTsWcf6Jx K6GY4j2Iflxjb/poXoycZZnN05r72gxESTuhWNjhiTSNbbV2dUew4X7XzefD8MAXxFBj nMbANwCEewYkFJDZfvVMjquuuR4dcyTqvYS5W7rIXDYUBhUiUP10ahK6LtCM3g3b7Kru ADWv4TVZLYnaHDu9s5tikIGal7liJBwOdh2G5dKfTD0HbmoJz9iSGEiYIPcokG7Zm1Jg lWJA== X-Gm-Message-State: APjAAAXkT1j1cx3l+DEHJp+AxALv0z5dmMaJUQL7Ot5UTPIjwHQ+1Jb0 OiWVU36KvYGPHtm8JFPHndg= X-Google-Smtp-Source: APXvYqyHQjRYFKVsyb9fpuM9++YKCCEEOy55sI8xBmbf3cq9wfSBTTHMHKmx0zsXhNHLCf2m37p1ww== X-Received: by 2002:a1c:541b:: with SMTP id i27mr26849300wmb.137.1578994283622; Tue, 14 Jan 2020 01:31:23 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id e16sm18915745wrs.73.2020.01.14.01.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 01:31:22 -0800 (PST) Date: Tue, 14 Jan 2020 10:31:22 +0100 From: Michal Hocko To: "Kirill A. Shutemov" Cc: Wei Yang , hannes@cmpxchg.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com, yang.shi@linux.alibaba.com, alexander.duyck@gmail.com, rientjes@google.com Subject: Re: [Patch v2] mm: thp: grab the lock before manipulation defer list Message-ID: <20200114093122.GH19428@dhcp22.suse.cz> References: <20200109143054.13203-1-richardw.yang@linux.intel.com> <20200111000352.efy6krudecpshezh@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200111000352.efy6krudecpshezh@box> User-Agent: Mutt/1.12.2 (2019-09-21) 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 Sat 11-01-20 03:03:52, Kirill A. Shutemov wrote: > On Thu, Jan 09, 2020 at 10:30:54PM +0800, Wei Yang wrote: > > As all the other places, we grab the lock before manipulate the defer list. > > Current implementation may face a race condition. > > > > For example, the potential race would be: > > > > CPU1 CPU2 > > mem_cgroup_move_account split_huge_page_to_list > > !list_empty > > lock > > !list_empty > > list_del > > unlock > > lock > > # !list_empty might not hold anymore > > list_del_init > > unlock > > I don't think this particular race is possible. Both parties take page > lock before messing with deferred queue, but anytway: > > Acked-by: Kirill A. Shutemov I am confused, if the above race is not possible then what would be a real race? We really do not want to have a patch with a misleading changelog, do we? -- Michal Hocko SUSE Labs