Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2316550ybl; Thu, 30 Jan 2020 15:22:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzW5lJLzKZus+YzMp80bcQkVfS7aKbbLapkNnux20ql9LXVz5Q8fEiI8Dx/EftaCCovXp3R X-Received: by 2002:a9d:624e:: with SMTP id i14mr5524327otk.371.1580426564029; Thu, 30 Jan 2020 15:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580426564; cv=none; d=google.com; s=arc-20160816; b=OIw3Xu/hcTDpMQiMqCPPwNFF97q0lBDyEPM4tjXf+UDB+OgZ3C9115wOlqg9JhLuHN EzJmwBs7AA6AA7jbKNFfQeNLFpzDObfKbROzj1P7J3FcnaL0EfTChxqJ9UQgj/3Fiynf cl1PcRdcg87zYVkSil/Wj0K76cjMLoPzKYHllMyl71t8f2IuB9rsQQwRMIx0gVlW2lZ3 vbw8ctFxPihXuel8hP8uFunDYYF3UFdjYlvwJXdTNN3yOAmwXcmbRnk/tv3sAyBms+PC FjzL1uT/Po/DIJlELsDKmC/iIrWwf3v2ePHEqp3BwsSbNofll6oU1iqPHnA7QYzp1b59 UcSw== 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=XSsZcaTfXOTFMqkKy3ZnZWZbmKJX0x/xuamjtfc8mfk=; b=XH4UYL+Ig/RTVkYeLOl/WHmd3yie4sTCTw/vMiukA39y4NU67CnQN0lME3cFH2iCsT d+HJTL2p9q73/KwZYgoKx5lnLiTWxebj5igvwyTrXTxTLW0n8M1RjR06d5CLCol2DmZS GHtaFo1ogXxciAzug2mqX6Mw3jurtAeyhVoJiE1IqXaBXbJt4xYxYNInDPTWFzLgPmAa AswiqkgGG6CBaAH7TtyZ8qF35VYkl/Lv+WnLJOZfK/qHdqhS8KZ5dZzZndXZ/R4Tlk9A vyoNjQxWDga29JmKKIvgxa+biv64rq49Vh5P3NoS9zYCfFMdUk9yemI/sW5qC831u3Nc JM+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xw5+tmp+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f11si1683195oti.104.2020.01.30.15.22.32; Thu, 30 Jan 2020 15:22:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xw5+tmp+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727610AbgA3Ww0 (ORCPT + 99 others); Thu, 30 Jan 2020 17:52:26 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:35503 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbgA3WwZ (ORCPT ); Thu, 30 Jan 2020 17:52:25 -0500 Received: by mail-ot1-f68.google.com with SMTP id r16so4788879otd.2 for ; Thu, 30 Jan 2020 14:52:25 -0800 (PST) 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=XSsZcaTfXOTFMqkKy3ZnZWZbmKJX0x/xuamjtfc8mfk=; b=Xw5+tmp+ErELACNDrM55VJgVQo5HyMVRPz03mHg0bvUr1o3WLBt2ztpTwqWNQ4C0cz wpoBqQ73TseKUZ8LDU9ET88Pi5YITbV03hAd07uV++wHLHZXPZGx4VKWxGVexrtMY6Yz 72uHZ7V4nOvxWxQGxD5tABvYW95KNOzueJQ34cQIwX8QbpwuSVeby9/H0+Jq2KuXH59V o5aDsxn/mdcpXjXG0Crki9njtDgVbCcKHaFxxDG456PtfNHslwX+4+KOyHiAHZiPpjs6 sbj1cQrJvOPRU9kmKgkGMdkR4NpB4AAaGF8xwA6EMAY5B9cnggQJj2OJ8ijfZjCFPx2/ z0eQ== 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=XSsZcaTfXOTFMqkKy3ZnZWZbmKJX0x/xuamjtfc8mfk=; b=MAz0L6zgQ2bOUDpP8+m9oGFLS0uWIQbY+r8sQe16AaoXq+cy/XXGlaXZALgzrRycIE 5oQnOyLSawU3dNGXniV19k5IS/FRBUi0EUHSdcbX59o4kn6pVjw/3qbmwM0zW+7yPPR9 Hbz2zw4PSYk9WoxElt2fGSLOHVafvv8NRoJ1A3idA/7hEFuby6bhgUPEoByA+AENgKJ8 rSgAnUaNf+uqfPvsPkATP0Ny97/ZuDJDCHeQ04JYHdXnYQU/zIlJqhGTHz76tYq5iXBk GPZMPhC30mvT2MXdnhaDDFWm3WMHf9cDr3eefhHyxxsf6XCFUllNH1JfnLUc7EFgSCwe PmHA== X-Gm-Message-State: APjAAAVcwE//ylkX9AlJY3Vn1+xp5AL9fzHvLUsZuRjMnM+wKQilyPkm UxNBAPEN/aq9UrTzKM0gMmLWBLWD2j6OashfCd4= X-Received: by 2002:a05:6830:1e64:: with SMTP id m4mr5653105otr.244.1580424744732; Thu, 30 Jan 2020 14:52:24 -0800 (PST) MIME-Version: 1.0 References: <20200121090048.GG29276@dhcp22.suse.cz> <20200126233935.GA11536@bombadil.infradead.org> <20200127150024.GN1183@dhcp22.suse.cz> <20200127190653.GA8708@bombadil.infradead.org> <20200128081712.GA18145@dhcp22.suse.cz> <20200128083044.GB6615@bombadil.infradead.org> <20200128091352.GC18145@dhcp22.suse.cz> <20200128104857.GC6615@bombadil.infradead.org> <20200128113953.GA24244@dhcp22.suse.cz> In-Reply-To: From: Cong Wang Date: Thu, 30 Jan 2020 14:52:13 -0800 Message-ID: Subject: Re: [PATCH] mm: avoid blocking lock_page() in kcompactd To: Michal Hocko Cc: Matthew Wilcox , LKML , Andrew Morton , linux-mm , Mel Gorman , Vlastimil Babka 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, Jan 28, 2020 at 11:44 AM Cong Wang wrote: > > On Tue, Jan 28, 2020 at 3:39 AM Michal Hocko wrote: > > > > On Tue 28-01-20 02:48:57, Matthew Wilcox wrote: > > > Doesn't the stack trace above indicate that we're doing migration as > > > the result of an allocation in add_to_page_cache_lru()? > > > > Which stack trace do you refer to? Because the one above doesn't show > > much more beyond mem_cgroup_iter and likewise others in this email > > thread. I do not really remember any stack with lock_page on the trace. > > I think the page is locked in add_to_page_cache_lru() by > __SetPageLocked(), as the stack trace shows __add_to_page_cache_locked(). > It is not yet unlocked, as it is still looping inside try_charge(). > > I will write a script to see if I can find the longest time spent in reclaim > as you suggested. After digging the changelog, I believe the following commit could fix the problem: commit f9c645621a28e37813a1de96d9cbd89cde94a1e4 Author: Tetsuo Handa Date: Mon Sep 23 15:37:08 2019 -0700 memcg, oom: don't require __GFP_FS when invoking memcg OOM killer which is not yet in our 4.19 branch yet. We will sync with 4.19 stable soon. Thanks.