Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933610AbdDFGji (ORCPT ); Thu, 6 Apr 2017 02:39:38 -0400 Received: from mga07.intel.com ([134.134.136.100]:22348 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932371AbdDFGjZ (ORCPT ); Thu, 6 Apr 2017 02:39:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,283,1488873600"; d="scan'208";a="244894689" Subject: Re: [PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*() To: Vlastimil Babka , Richard Weinberger , Michal Hocko References: <20170405074700.29871-1-vbabka@suse.cz> <20170405074700.29871-5-vbabka@suse.cz> <20170405113157.GM6035@dhcp22.suse.cz> <9b9d5bca-e125-e07b-b700-196cc800bbd7@suse.cz> Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mel Gorman , Johannes Weiner , linux-block@vger.kernel.org, nbd-general@lists.sourceforge.net, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, Boris Brezillon From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Thu, 6 Apr 2017 09:33:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <9b9d5bca-e125-e07b-b700-196cc800bbd7@suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1009 Lines: 23 On 05/04/17 14:39, Vlastimil Babka wrote: > On 04/05/2017 01:36 PM, Richard Weinberger wrote: >> Michal, >> >> Am 05.04.2017 um 13:31 schrieb Michal Hocko: >>> On Wed 05-04-17 09:47:00, Vlastimil Babka wrote: >>>> Nandsim has own functions set_memalloc() and clear_memalloc() for robust >>>> setting and clearing of PF_MEMALLOC. Replace them by the new generic helpers. >>>> No functional change. >>> >>> This one smells like an abuser. Why the hell should read/write path >>> touch memory reserves at all! >> >> Could be. Let's ask Adrian, AFAIK he wrote that code. >> Adrian, can you please clarify why nandsim needs to play with PF_MEMALLOC? > > I was thinking about it and concluded that since the simulator can be > used as a block device where reclaimed pages go to, writing the data out > is a memalloc operation. Then reading can be called as part of r-m-w > cycle, so reading as well. IIRC it was to avoid getting stuck with nandsim waiting on memory reclaim and memory reclaim waiting on nandsim.