Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp635678pxk; Wed, 9 Sep 2020 14:53:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzQ476ZZZKGu2q7C5uUZhB87c9w7nrKKrsItj4gx445Lmb86zdNUOg8BjchcgfhjbU9sXx X-Received: by 2002:aa7:cd06:: with SMTP id b6mr6006346edw.196.1599688400501; Wed, 09 Sep 2020 14:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599688400; cv=none; d=google.com; s=arc-20160816; b=dD9DGW2pq1SiiUMOTGbP3DyxJ/9FU7xQOHMBviy4Or2MDxSRwj4/2Un4ssX6Io+eCV 74oCs2qWHPmw1Pfb4LIcZum4lYZ+sQsom0aNGyMPE5CtG7rCH7PndEGoOXAVYM4/N1xc vnOzN/G8p/IGNtn8oe+LSiLxQrkAO3p2d6gYbOksS9RTCKrGilBe1j1h1Q8WxwKsaPy2 iUYiW1TyMuw/gjwu/7OIT6ifiqHSzsuU7jtT2aZuuoF5CiSJRzJyW/OCy1B9wjSTCbDP 0GU/d0NACsLOR1qJ2kEWNgemlZsvW83PLCbCnfdsmvg9+ce6qdDKabQe1EJ2Z/hVbvVP pKHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9AelBTRGGkaycQWCIOP8/Ny69L3JnwJ2r2LMDHo8IXc=; b=fmcuPTZbIBIk/O/wujLrfHxmxYJaA8mXX4ycRXIVf+NvMP28H4p20dmxcChjUgUaPw WV0+uIf2aXRUY9Aq3KEMiCQ2Nn/DKUZQh+76ig+ZjwGKFPdMOihMjjcpMUmpeILuxSn4 7KF3YjRTa1HSeLaZuWDfHoXiOwsFJ3wW3xePJjzSFtLiwKWCwQa85d+LNywQZnAoNEsy dS5gqi/ETNwZEBRhU0nBgYEFJ77Osf7r0SCUMSGVk1xvRhyQWQk+DAH5H0YAHVV1LUgi UNL2tovPQvYrmXX8HpdKLeJfpKMLKeX5BVa/kBw9+HjU5Z/T1N5/EqNG6/KPZK34yumO T6zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=uhJlBGKa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y22si2308837edo.147.2020.09.09.14.52.57; Wed, 09 Sep 2020 14:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=uhJlBGKa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728207AbgIIVwQ (ORCPT + 99 others); Wed, 9 Sep 2020 17:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbgIIVwM (ORCPT ); Wed, 9 Sep 2020 17:52:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40DBC061573 for ; Wed, 9 Sep 2020 14:52:11 -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=9AelBTRGGkaycQWCIOP8/Ny69L3JnwJ2r2LMDHo8IXc=; b=uhJlBGKaw4qHaktb6IwOYqmKKP fjkviTcwwyFqfqZ3qvJZ88vgCUgR5rDFTt6bStcnT1bXx3rH9LlCWapM1lQ3hdU+/cNPY2Qo2jFaX LWCLK6t49O/+R09xAutwb83n97LxQmkPai5qBqGobBdwOxN1g/gDe/diTqFrGjw5vK2kQEeYvRVpg qJ4EMLxgqEQCIpHJJ+pdvAO1K3RJxBRvuQDqkXOrbbm4KhMpyJ4+bZD6PR4dxTA4DED/srM96Q7MI f7OUL8bQR2yJPtremyonRj/QIN0GHlKD3x2X71y5Samsejj6VTX08qM2JskDow2G9rVdd81fIp96e 1ZW5+piw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG80f-0000Zc-4A; Wed, 09 Sep 2020 21:52:09 +0000 Date: Wed, 9 Sep 2020 22:52:09 +0100 From: Matthew Wilcox To: Chris Down Cc: Vlastimil Babka , zangchunxin@bytedance.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: Re: [PATCH v2] mm/vmscan: fix infinite loop in drop_slab_node Message-ID: <20200909215209.GP6583@casper.infradead.org> References: <20200909152047.27905-1-zangchunxin@bytedance.com> <16906d44-9e3c-76a1-f1a9-ced61e865467@suse.cz> <20200909214724.GA1577471@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200909214724.GA1577471@chrisdown.name> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 10:47:24PM +0100, Chris Down wrote: > Vlastimil Babka writes: > > - Exit also on other signals such as SIGABRT, SIGTERM? If I write to drop_caches > > and think it's too long, I would prefer to kill it by ctrl-c and not just kill > > Oh dear, fatal_signal_pending() doesn't consider cases with no more > userspace instructions due to SIG_DFL on TERM/INT etc, that seems misleading > :-( I had (naively) believed it internally checks the same set as > TASK_KILLABLE. > > Chuxin, Muchun, can you please make it work using TASK_KILLABLE in a similar > way to how schedule_timeout_killable and friends do it instead, so that > other signals will be caught? You're mistaken. if (sig_fatal(p, sig) && !(signal->flags & SIGNAL_GROUP_EXIT) && !sigismember(&t->real_blocked, sig) && (sig == SIGKILL || !p->ptrace)) { ... sigaddset(&t->pending.signal, SIGKILL); static inline int __fatal_signal_pending(struct task_struct *p) { return unlikely(sigismember(&p->pending.signal, SIGKILL)); }