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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC6B1C6FA82 for ; Wed, 14 Sep 2022 23:02:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 004018D0001; Wed, 14 Sep 2022 19:02:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF47A6B0073; Wed, 14 Sep 2022 19:02:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D956A8D0001; Wed, 14 Sep 2022 19:02:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C4B216B0071 for ; Wed, 14 Sep 2022 19:02:19 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9890D40405 for ; Wed, 14 Sep 2022 23:02:19 +0000 (UTC) X-FDA: 79912216398.29.C9AF8E5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf01.hostedemail.com (Postfix) with ESMTP id 22E7D40094 for ; Wed, 14 Sep 2022 23:02:17 +0000 (UTC) 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> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663196538; a=rsa-sha256; cv=none; b=moDtcL9NBUZtzcQIcnCC9BvN9XYdB+xUn/mB72oyh19TUi8oQ2WdEVmY5AvYwYQxSTvxUd PMyfjq6PcuKMNuqzvpgthamvgwBg1dTcTWA1q/sZUUiFjK2/AZ0wggLTdge6aoWgQMnHOK 9MydL272qUJdtgFRdlsMJUCDzlRK3Z4= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="MteI3Z/T"; dmarc=none; spf=none (imf01.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663196538; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q0AmhJ66BcoKwGqCpa8ZnB7weX2R83u//PNx4e8dS3M=; b=Bu7/EVgxyz2CxE+wymmQunSOnHftCwg61LJGgU8JEYZc+9hrxsyYDbJJ7uc/27hxPuouHO Asv8BZ+QcmhjAyg8OA6MoWsKvuYQX1hPA0LwFmaivyOx5lQipxICgKKoFs+ypyA+fCNzKy jLcLZVSFvDcmxtkDHORwRvgUEjn/Rgg= X-Rspam-User: Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="MteI3Z/T"; dmarc=none; spf=none (imf01.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam11 X-Stat-Signature: uxunbysm93gqzzw3spjj8xz7q85i86i5 X-Rspamd-Queue-Id: 22E7D40094 X-HE-Tag: 1663196537-444420 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 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?