Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp753821imu; Sat, 15 Dec 2018 06:40:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/XW5z+WSBgOZrstzBpNCKJ1B6PXmXDv9qM/WejYDTnBZhcs94r3wXO64pN05y2llObLnYr3 X-Received: by 2002:a63:5c22:: with SMTP id q34mr6214683pgb.417.1544884820820; Sat, 15 Dec 2018 06:40:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544884820; cv=none; d=google.com; s=arc-20160816; b=ctoh0adMNcSXKz0bWO/oeoz0nvilKMAeNSDRVpn7AjtPJwX7cSiO9cjrux1sKFeMFH 9+SfJpTgSNGRE0R8XUAMeoso0xLrXE4oV4mg2sjL5f495h0z3XmZAlp4ZdZY6eh1dLOY WYo/RaHCFWkD4RE8zAJgRD2JVoOHt3NGfA+5fKVutiOM10d7p82FLiV2kq+3kLmTuNRK 0BQTx309o6QWpGancTKPcHbffNCXukLUjFZixebC2Gt+nA9bebnykThS3t6ugORPu4Mg rZw3mu72J3xhw+EkWKm+4LQqmigTMy5ru3/HE4lpmXI7GooNYl9RDolmam5AemC7sjm6 RSfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=K0TEN6zKhxTPkeJUq0ZFuza1Gbk5FJ/I21zern5TdZA=; b=lPGbTopkDXVu9i7qPNjlI9yRIbXx7sknCPMZRNlM49ahAIuesoquQPNPmpTYIm19vY hkE38oiw/qoQr2fGQKn/AO0JibAcp1fkh7DxTRsNdnw4P5TrT3J5bWYQxOEozXHeakqZ RIPoLumq7zrkNGTD0CAZXYcn3TvCVXz6qn5WawxR/xDmuaAz20ypB3BF+NK/+IVL2QU0 ZBkTRdvM4JT3Gdea3ZOM6gB9HqggcRbhpt0UufwZv173gb9z59e4DJ/Ql1rbM46yIBiv BqL/DP4y8jA4iI4b3rBOZQQmefD8o5gqlqwBCyjQUAhcpE4Zql+h8DU/Ew/1Qu+fVbv0 2T7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fQXVX4AQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si6332846pgb.564.2018.12.15.06.39.51; Sat, 15 Dec 2018 06:40:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fQXVX4AQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730153AbeLOOic (ORCPT + 99 others); Sat, 15 Dec 2018 09:38:32 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58500 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729687AbeLOOic (ORCPT ); Sat, 15 Dec 2018 09:38:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=K0TEN6zKhxTPkeJUq0ZFuza1Gbk5FJ/I21zern5TdZA=; b=fQXVX4AQMkz3m80ztQBGQTxRk XWIt4nnwoLu+Xw2ZjNk1LSvknCJK/8TNOL1sbIs48oE4ZqgdZ5AzHKBIgdRHT61OLcNjVV3DXumUf f7dtPFyirH6ttCj4f8gSEugJ0slDzqYh0UPWHvJhQcvf+y9CPeDrixTcSj8iZ52ZNolCNknZk5B/N Jhad+t64gmvq/HZxDZBk6WtNAZmPnflYUbkkcfZ8FJbfKbaFTrOkWkFjsk2f8ZQ7BPkvxOxwykbBd ZUhCELP8Ah/mdvE5mZ52lhBdAMo378G8YF8991QKiEPkV91cOVPm28L3hXHGtlg8q/S9nT1hR0gpq Cj/axl8ww==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYB5E-0006ED-94; Sat, 15 Dec 2018 14:38:24 +0000 Date: Sat, 15 Dec 2018 06:38:24 -0800 From: Matthew Wilcox To: Hou Tao Cc: phillip@squashfs.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc Message-ID: <20181215143824.GJ10600@bombadil.infradead.org> References: <20181204020840.49576-1-houtao1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204020840.49576-1-houtao1@huawei.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 04, 2018 at 10:08:40AM +0800, Hou Tao wrote: > There is no need to disable __GFP_FS in ->readpage: > * It's a read-only fs, so there will be no dirty/writeback page and > there will be no deadlock against the caller's locked page > * It just allocates one page, so compaction will not be invoked > * It doesn't take any inode lock, so the reclamation of inode will be fine > > And no __GFP_FS may lead to hang in __alloc_pages_slowpath() if a > squashfs page fault occurs in the context of a memory hogger, because > the hogger will not be killed due to the logic in __alloc_pages_may_oom(). I don't understand your argument here. There's a comment in __alloc_pages_may_oom() saying that we _should_ treat GFP_NOFS specially, but we currently don't. /* * XXX: GFP_NOFS allocations should rather fail than rely on * other request to make a forward progress. * We are in an unfortunate situation where out_of_memory cannot * do much for this context but let's try it to at least get * access to memory reserved if the current task is killed (see * out_of_memory). Once filesystems are ready to handle allocation * failures more gracefully we should just bail out here. */ What problem are you actually seeing?