Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp448293pxv; Wed, 14 Jul 2021 07:38:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqLVBKfBZIRfsr70kItWVzznspt/zYnClu9PAoQcFlmtVBN3XawP43m4pxpKcKnrY9jxcH X-Received: by 2002:a17:907:1de7:: with SMTP id og39mr12716889ejc.221.1626273498986; Wed, 14 Jul 2021 07:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626273498; cv=none; d=google.com; s=arc-20160816; b=bkR5X6xlBfzJ3WlTZx9UtIagQ4awmPN1dzgOJySVYFf0iE4bqHSrpnis2VJuV10ke2 lVcyVi+el7+jFkUYUCdH1xArIrcRPWbB957vf5LaKhQqUUPcOO3NTSGNEKfWZTlYKPhk v+QYKgwIeYv4ELSzmSvG2e0Qpmsr2wqqoIQP2MiHrpVXjJCJoJB8GXoYcNaR7MyS+1lJ ngxdRkRhoEEvig/tuYc7XPtA9+Get/L5qczBdpxsH9OddCW16IHRZno29G4Fxc7f+IBj T9u4gtd0L35k28xklKMU7wQl28qi7eEYsa4xjdXQjvdhh3WGAYG4jqAj6cN85ZQTSvD/ cIpg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Af9zMHeqi8aU1b8R7HQ3pE9s7xYasPzAL+lA7Sq+Erc=; b=zVz8oQTBLWvi0fpUfga8BVFU2t5trGaNQLfWgQyPnEu5RIWQKc3q9/sbdMrha8EMmh Khblj+QvsKZMwnPXkTzb1wxDCjhBrq/gngoothTNdcfnYlOPcchp1KTAcrzuZBplWwOP BlMcpRTLeGbXkRQ4tdfc65uZUCW+VmlNDNRhOl8tift7SogMAMnxfeIGXpHlmya9K2om LED4THeTA3gnPba4ma2xLdUO3fHP//y/5EDsMaw1bDlIC8TXXcxaonAvMzcfxRg3rUg6 Vd4/2GtTcNWK65ScYzxlsyYC9p3mdFsuCkVKAZoEHvZKMzZQylXM+CC7gUgR2oIF9KEN lvpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=goSPEgkj; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f27si3344108ejf.63.2021.07.14.07.37.54; Wed, 14 Jul 2021 07:38:18 -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=pass header.i=@suse.com header.s=susede1 header.b=goSPEgkj; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232100AbhGNOjn (ORCPT + 99 others); Wed, 14 Jul 2021 10:39:43 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:37834 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231977AbhGNOjn (ORCPT ); Wed, 14 Jul 2021 10:39:43 -0400 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 Content-Transfer-Encoding: 8bit In-Reply-To: <7074179d.c3fd.17aa3f148cc.Coremail.wuzhouhui14@mails.ucas.ac.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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-foundation.org, nico@fluxnic.net, wang.yong12@zte.com.cn > > Cc: > > Subject: Re: [BUG] ramfs system panic when using dd to create files > > > > Hello, is there any solution, or how to avoid this problem when using ramfs? > > Limit max size of ramfs. > > > > > yong w 于2021年7月7日周三 下午5:58写道: > > > > > > When I use dd to create files multiple times under the ramfs file > > > system,Panic appears, indicating that there is no process 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 shouldn't > > > cause the system to panic. > > 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. -- Michal Hocko SUSE Labs