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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 16302C11F67 for ; Wed, 14 Jul 2021 14:36:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A0A7961369 for ; Wed, 14 Jul 2021 14:36:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0A7961369 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C0E096B0083; Wed, 14 Jul 2021 10:36:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BBC1C6B0085; Wed, 14 Jul 2021 10:36:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A83AD6B0088; Wed, 14 Jul 2021 10:36:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 855E76B0083 for ; Wed, 14 Jul 2021 10:36:53 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 735A62D24D for ; Wed, 14 Jul 2021 14:36:52 +0000 (UTC) X-FDA: 78361445064.33.EBC86F8 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf11.hostedemail.com (Postfix) with ESMTP id 0425BF000229 for ; Wed, 14 Jul 2021 14:36:51 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id B8904202BE; Wed, 14 Jul 2021 14:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1626273410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Af9zMHeqi8aU1b8R7HQ3pE9s7xYasPzAL+lA7Sq+Erc=; b=goSPEgkj/LMYVuyHS3HzjsISnwz96IAR9tufnsb6HbMQD4IukAXW45LnQfJU5SEByPsz0b SVF2k8Dkmr3MmWc4yz7rgiUuNf3V2FYEiPQKzLjwhlllRtD2FzRS4eL131Ev4yu1ZtZ/Ta EigEqE8nsyXZ21oETXTW/Wlzajd7mnA= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 4F491A3BBA; Wed, 14 Jul 2021 14:36:47 +0000 (UTC) Date: Wed, 14 Jul 2021 16:36:47 +0200 From: Michal Hocko To: wuzhouhui Cc: yong w , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, nico@fluxnic.net, wang.yong12@zte.com.cn Subject: Re: Re: [BUG] ramfs system panic when using dd to create files Message-ID: References: <7074179d.c3fd.17aa3f148cc.Coremail.wuzhouhui14@mails.ucas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7074179d.c3fd.17aa3f148cc.Coremail.wuzhouhui14@mails.ucas.ac.cn> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0425BF000229 X-Stat-Signature: xpgdhmcis9ghjuddgy1hae8mowu33ikj Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=goSPEgkj; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf11.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1626273411-772683 Content-Transfer-Encoding: quoted-printable 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 14-07-21 15:35:36, wuzhouhui wrote: > > -----Original Messages----- > > From: "yong w" > > Sent Time: 2021-07-14 08:24:23 (Wednesday) > > To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-f= oundation.org, nico@fluxnic.net, wang.yong12@zte.com.cn > > Cc:=20 > > Subject: Re: [BUG] ramfs system panic when using dd to create file= s > >=20 > > Hello, is there any solution, or how to avoid this problem when us= ing ramfs? >=20 > Limit max size of ramfs. >=20 > >=20 > > yong w =E4=BA=8E2021=E5=B9=B47=E6=9C=887=E6=97= =A5=E5=91=A8=E4=B8=89 =E4=B8=8B=E5=8D=885:58=E5=86=99=E9=81=93=EF=BC=9A > > > > > > When I use dd to create files multiple times under the ramfs= file > > > system=EF=BC=8CPanic appears, indicating that there is no pro= cess to kill. > > > I learn that ramfs will automatically grow space due to data = writing, > > > causing all the system memory to run out, but i think it sho= uldn't > > > cause the system to panic. >=20 > The comments already explains why kernel should panic on this situation= : > /* > * If we got here due to an actual allocation at the > * system level, we cannot survive this and will enter > * an endless loop in the allocator. Bail out now. > */ That is the oom side of the things. And that is way too late to do anything more reasonable. It is suspicious that the ramfs can consume arbitrary amount of memory. I would be looking there. --=20 Michal Hocko SUSE Labs