Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp335182pxv; Thu, 15 Jul 2021 05:31:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzjRak4far+22OzX8ZOTw5idtRkCwkA9BDYsWXok8r9m6L8tag4xt3HEO1T8V93+wPuSeD X-Received: by 2002:a17:906:1e8a:: with SMTP id e10mr5427486ejj.278.1626352316699; Thu, 15 Jul 2021 05:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626352316; cv=none; d=google.com; s=arc-20160816; b=ECTOCDW7TxeT4HDfxPBBO/wQdK0JscH8uPyXhFsud3rJv0Um19AQQWDvC38hAKuq+b VAGJ/xkia+rOPovgEcQws6NkdpZNsSN3gbiQplOIue2lIHO6Q22cHlQeTaz4sb+Lsckq QHcc4kkFRmhcpsfMqQ2WmOajap7Vwgskb20CYBMWQXRwgmHJTrj3BncMqyo3XOwJR9Ae N5zyE5uUK8r87juxT1T5hXutV2hd1eqXGWUKPTqqG0YzesKQ4ex7XJPHrhHSXgeORRtS IosN6U6fUKmSxXl5Sm4bmlvZHXjrNSXSG1x4J6xfjXDlaTIYbkik7i0twiFf/sAhWNnk DZRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=tb41KgoM+NiGJ70a5q4pt9EEJpDzWUZ07eGfjwwiPAQ=; b=M8r9tOMAHH/5cCNXXcvdCOvrUSevQUi2E8sBtXSiZD76avJvpk6r0fKPvZGovUB6Qo XdphZMbRcE8qY/D7LeeeHBjhR0tyT+Fh6Eoy0HN0EOOJ4k3+PzHBXOxPk6mh6QW5lOZK BXARvq1Gyd1eUFtFkTkGGM4OCfbybEGkMSNnKSJS4kh8qv7fP4E0Ye6XcUrXKHuos79y EiLBYGjzjDsd8tvKipqpHwqr3rjb9m3Gz0W//lwDqGCgYf7YJ4AgEMEN8BO5egHdW1Yx ozyCZz6RByoiBalHnRLu7p4jw/IShFo0h+BIQmQQM2rWWMRaxB2+e52lPsnNoQuBI0DI ++MA== ARC-Authentication-Results: i=1; mx.google.com; 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 em21si7044746ejc.542.2021.07.15.05.31.32; Thu, 15 Jul 2021 05:31:56 -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; 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 S229737AbhGOLrU (ORCPT + 99 others); Thu, 15 Jul 2021 07:47:20 -0400 Received: from outbound-smtp25.blacknight.com ([81.17.249.193]:48078 "EHLO outbound-smtp25.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbhGOLrU (ORCPT ); Thu, 15 Jul 2021 07:47:20 -0400 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp25.blacknight.com (Postfix) with ESMTPS id 30EE9CAE50 for ; Thu, 15 Jul 2021 12:44:26 +0100 (IST) Received: (qmail 5069 invoked from network); 15 Jul 2021 11:44:25 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.255]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 15 Jul 2021 11:44:25 -0000 Date: Thu, 15 Jul 2021 12:44:24 +0100 From: Mel Gorman To: yong w Cc: wuzhouhui , 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: <20210715114424.GR3809@techsingularity.net> References: <7074179d.c3fd.17aa3f148cc.Coremail.wuzhouhui14@mails.ucas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 14, 2021 at 10:30:22PM +0800, yong w wrote: > Thanks for your reply! > > > Limit max size of ramfs. > It's no use using size to limit the size of ramfs. > "mount -t ramfs -o size=10M ramfs /ramfs" is the command i use. > ramfs does not support size= limiting, that's what tmpfs is for. > > > > 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. > > */ > > But it causes panic, actually , I don't want it panics Then use tmpfs and specify size=. It's mentioned in filesystems/tmpfs.rst --8<-- If you compare it to ramfs (which was the template to create tmpfs) you gain swapping and limit checking. Another similar thing is the RAM disk (/dev/ram*), which simulates a fixed size hard disk in physical RAM, where you have to create an ordinary filesystem on top. Ramdisks cannot swap and you do not have the possibility to resize them. --8<-- -- Mel Gorman SUSE Labs