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=-0.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 E0FA6C433E2 for ; Wed, 9 Sep 2020 15:26:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 69BC622273 for ; Wed, 9 Sep 2020 15:26:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.b="FDRwnxzL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69BC622273 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A4C9C900002; Wed, 9 Sep 2020 11:26:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D7156B0095; Wed, 9 Sep 2020 11:26:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89D4E900002; Wed, 9 Sep 2020 11:26:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id 715D06B0092 for ; Wed, 9 Sep 2020 11:26:43 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3187E3626 for ; Wed, 9 Sep 2020 15:26:43 +0000 (UTC) X-FDA: 77243900286.22.tub66_3712c2a270de Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 01EEC18038E6C for ; Wed, 9 Sep 2020 15:26:42 +0000 (UTC) X-HE-Tag: tub66_3712c2a270de X-Filterd-Recvd-Size: 5726 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Sep 2020 15:26:42 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id k25so4062413ljg.9 for ; Wed, 09 Sep 2020 08:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KCB14QRMC2N5xz5XO89jN+PrH20AQtMDcDvMV3YjGZ4=; b=FDRwnxzL+yLoJgX54gYSJ/moJaP8MVCGyhs2XfezzsTKubKVENvDz04wHZYMgGA91J BuMY2JujZjqIl2b98/OJbMm0xHjaJGgDJZoEtLZCDJAOAIeCENlrhB85EVVkq4e79MtD T38fw0+JtLr5otdfqxNi0YYViYIygH9uYMu0ZbGfdYcHPL1e2PGO9bw1ABOf+4Jfy0J7 S2NIRrCToU/U7SO6jm9gehOBgPyWGZ7gZvgrCsKoePZ+OAVUKwq6UA0UJ/YCqqPhqt6O xohB6e/jKYRERwObobkd5TV0p6F2CH6mwQr0GHa0pxNYlKF+ntae/nwqhXs4VOXBppsV v9FQ== 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=KCB14QRMC2N5xz5XO89jN+PrH20AQtMDcDvMV3YjGZ4=; b=AMj3OIuX4YExby3caPV6ZDbMsEjexxQHtD5Jw4am5pM9F4OVqkTTpNtuvCrFA6rHnL pvwTGF+AodRaiZqLFQjjkUVtJ+sdOdCBWZFUBVZHUoI3X7CeeYELCDbrheP2uoOLueXy mXE3Y9jL5gM4iza0aO3y0rOWdG6KR9Npb8A9Z+WAxjhWhFLRcPiJN2Z+LtloT90DXVQ3 vXXS/Wzbd5+NN6SHFXv4CtH0hEXGQF8eWRmMUnAPYuQiuALtCVVfwLNhy1OzA3CPhbsB R8YXWC6nKewP51ww1S/tQBeUp+6u9QDYFa1z8v7LzMWU0/MLhqtXGMTUexXbMdzsHwaT mwzg== X-Gm-Message-State: AOAM5306lBkOdLoVwV8HHTnltE0UrdtGyMbhTRwk8FR/YtNsPmMfGBbg IakpPh6Vhrb8KSt65JpLZwRXcZgTmCRs+BzAV/bemA== X-Google-Smtp-Source: ABdhPJxPD/jR7Ag9Gy5qH5+9tjowsAXr4UXWKAEWrSEJnuRLzZLovSGDgz0pcYvd+/MoQaPFhGdAI2zNvv8Kvdoh4KM= X-Received: by 2002:a2e:9057:: with SMTP id n23mr2307445ljg.411.1599665201111; Wed, 09 Sep 2020 08:26:41 -0700 (PDT) MIME-Version: 1.0 References: <20200908142456.89626-1-zangchunxin@bytedance.com> <20200908150945.GA1301981@chrisdown.name> <20200909095915.GA1412646@chrisdown.name> In-Reply-To: <20200909095915.GA1412646@chrisdown.name> From: =?UTF-8?B?6Ien5pil6ZGr?= Date: Wed, 9 Sep 2020 23:26:28 +0800 Message-ID: Subject: Re: [External] Re: [PATCH] mm/vmscan: fix infinite loop in drop_slab_node To: Chris Down Cc: Muchun Song , Andrew Morton , Linux Memory Management List , LKML Content-Type: multipart/alternative; boundary="00000000000012819205aee31402" X-Rspamd-Queue-Id: 01EEC18038E6C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: --00000000000012819205aee31402 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Chris Down writes=EF=BC=9A > Muchun Song writes: > >1. Double the threshold currently hard coded as "10" with each iteration > > suggested by Vlastimil. It is also a good idea. > > I think this sounds reasonable, although I'd like to see what the > difference in > reclaim looks like in practice. > > >2. In the while loop, we can check whether the TASK_KILLABLE > > signal is set, if so, we should break the loop. like the following > code > > snippe. Thanks. > > > >@@ -704,6 +704,9 @@ void drop_slab_node(int nid) > > do { > > struct mem_cgroup *memcg =3D NULL; > > > >+ if (fatal_signal_pending(current)) > >+ return; > >+ > > freed =3D 0; > > memcg =3D mem_cgroup_iter(NULL, NULL, NULL); > > do { > > Regardless of anything, I think this is probably a good idea. Could you > send it > as a patch? :-) > > Thanks, > > Chris We have send the v2 version, please check. Best Wishes ChunXin --00000000000012819205aee31402 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Chris Down <chris@chrisdown.name>=C2=A0writes=EF=BC=9A
Muchun Song writes:
>1. Double the threshold currently hard coded as "10" with eac= h iteration
>=C2=A0 =C2=A0 suggested by Vlastimil. It is also a good idea.

I think this sounds reasonable, although I'd like to see what the diffe= rence in
reclaim looks like in practice.

>2. In the while loop, we can check whether the TASK_KILLABLE
>=C2=A0 =C2=A0 signal is set, if so, we should break the loop. like the = following code
>=C2=A0 =C2=A0 snippe. Thanks.
>
>@@ -704,6 +704,9 @@ void drop_slab_node(int nid)
>=C2=A0 do {
>=C2=A0 struct mem_cgroup *memcg =3D NULL;
>
>+ if (fatal_signal_pending(current))
>+ return;
>+
>=C2=A0 freed =3D 0;
>=C2=A0 memcg =3D mem_cgroup_iter(NULL, NULL, NULL);
>=C2=A0 do {

Regardless of anything, I think this is probably a good idea. Could you sen= d it
as a patch? :-)

Thanks,

Chris=C2=A0

We have send the v2 version, pl= ease check.

Best Wishes
ChunXin=C2=A0
--00000000000012819205aee31402--