Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp100331rwn; Wed, 14 Sep 2022 16:49:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4jKpQMx1FT8MA3uZvjfVp1SKkNzV1JJSYGDM/vXQDF8RA0yGVyZCXXYfrvH4skfj5aR0L/ X-Received: by 2002:a17:902:ca05:b0:177:324a:784d with SMTP id w5-20020a170902ca0500b00177324a784dmr1485961pld.11.1663199360969; Wed, 14 Sep 2022 16:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663199360; cv=none; d=google.com; s=arc-20160816; b=HvlrQO1xURywsyXdID3DoR/6+2whWwTcDTdJZBR2F9BBpcI+M5cCnJMll2pBem+woV jK+ElGdYXYNFHR1vO4ch0Zj56iFfrc0LpuBZwltpKqytbFsHLh6V5QAkVO0myRmCaeQ0 lcjsHlKap4FFSbEkbqB4qA6IrqnMY7aomjOPnyyozTWt0FYxFF2GGZs6SS2E5nazaenh Hkbox/i7BBmItZR2DA2wCQh/q5b2Nl7ZKXcTaONZ6efbZCt6VtV62AfWCRTuTgts6qvc s5kt64S1pJzVdT4/OarpcVJOHc3O/YNkKfYtfqiquVoYXnrLa5CAHTnw4qVeBniBc6bC 3a2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q0AmhJ66BcoKwGqCpa8ZnB7weX2R83u//PNx4e8dS3M=; b=SS5DxLwbHtjpIqGuzWXoEvLlHxa/W3zZqFMxd6Lh1p7Owc2yqzC9XuMZwJxuRh0pWc cF98WHZagnYc5ZE5/FX9GwfBdxz5bHEWpDoL2aYHwvUwtojTqBbE30op0ZgHCai4yuMO 1RC7Ca0IGcI+nCDwqhtsUm0AlXkf84owwRQZC/29Z8tp7PkL1AtYMBoVbR0q4mgF9fun +Wmrfp2kFf/PMq3lmPf31i24HXizfQ3PfKTpRWUTok6fq7Vh+rJE859zvYVhjhbmPUfs vtywMRno+t0WHIRP0xiQ1Bg1vw82h0n6nkz7kBUV/0mNJxwUma7MFSxZ0krR+9+5+hFI YgZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="MteI3Z/T"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh10-20020a17090b4aca00b001eccaceca72si18938370pjb.1.2022.09.14.16.49.09; Wed, 14 Sep 2022 16:49:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="MteI3Z/T"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbiINXCY (ORCPT + 99 others); Wed, 14 Sep 2022 19:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbiINXCV (ORCPT ); Wed, 14 Sep 2022 19:02:21 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C760086C11 for ; Wed, 14 Sep 2022 16:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Q0AmhJ66BcoKwGqCpa8ZnB7weX2R83u//PNx4e8dS3M=; b=MteI3Z/TAj+ZwVukeWG2feEHMF Qpzh8HrZgnvFTR5zsNjRVulNtZ8hCMwyuY6FSXXO+3d7AYZQviIHGUeSCDwOkctmudC9s29IdW+j2 6A4BVItmE9jkFRTfNoOxgmF9bDoByuUSUBLuUxH7TiETTSD7HAKOH1uOWLFg7ykn5vcNuUW56LnNY KaJr7StB3LlfTdmwpfZo2GBUFEJy7whNGMjSdbcbMsDMukl6saxCabDKq7KY2iVCKopWHf5gsEcSY dT4HFYRZE9Fp/TldK90Z2sueUu06067tBzOEuRDlJryMM/arh/m7GzpDy6YX1Kf5CtStCVBUQXbOz 9rHsp7yQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYbOY-000Zq5-JW; Wed, 14 Sep 2022 23:02:14 +0000 Date: Thu, 15 Sep 2022 00:02:14 +0100 From: Matthew Wilcox To: Andrew Morton Cc: Hongchen Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmscan: don't scan adjust too much if current is not kswapd Message-ID: References: <20220914023318.549118-1-zhanghongchen@loongson.cn> <20220914155142.bf388515a39fb45bae987231@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220914155142.bf388515a39fb45bae987231@linux-foundation.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2022 at 03:51:42PM -0700, Andrew Morton wrote: > On Wed, 14 Sep 2022 10:33:18 +0800 Hongchen Zhang wrote: > > > when a process falls into page fault and there is not enough free > > memory,it will do direct reclaim. At the same time,it is holding > > mmap_lock.So in case of multi-thread,it should exit from page fault > > ASAP. > > When reclaim memory,we do scan adjust between anon and file lru which > > may cost too much time and trigger hung task for other thread.So for a > > process which is not kswapd,it should just do a little scan adjust. > > Well, that's a pretty nasty bug. Before diving into a possible fix, > can you please tell us more about how this happens? What sort of > machine, what sort of workload. Can you suggest why others are not > experiencing this? One thing I'd like to know is whether the page fault is for an anonymous or file-backed page. We already drop the mmap_lock for doing file I/O (or we should ...) and maybe we also need to drop the mmap_lock for doing direct reclaim?