From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 279267F4E for ; Tue, 27 May 2014 05:38:31 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0E18C304043 for ; Tue, 27 May 2014 03:38:31 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) by cuda.sgi.com with ESMTP id JjGOdxcObLloUU61 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 27 May 2014 03:38:30 -0700 (PDT) Date: Tue, 27 May 2014 03:38:29 -0700 From: Christoph Hellwig Subject: Re: [PATCH 1/2] xfs: block allocation work needs to be kswapd aware Message-ID: <20140527103829.GA1440@infradead.org> References: <1401143214-9181-1-git-send-email-david@fromorbit.com> <1401143214-9181-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1401143214-9181-2-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: xfs@oss.sgi.com On Tue, May 27, 2014 at 08:26:53AM +1000, Dave Chinner wrote: > From: Dave Chinner > > Upon memory pressure, kswapd calls xfs_vm_writepage() from > shrink_page_list(). This can result in delayed allocation occurring > and that gets deferred to the the allocation workqueue. > > The allocation then runs outside kswapd context, which means if it > needs memory (and it does to demand page metadata from disk) it can > block in shrink_inactive_list() waiting for IO congestion. These > blocking waits are normally avoiding in kswapd context, so under > memory pressure writeback from kswapd can be arbitrarily delayed by > memory reclaim. > > To avoid this, pass the kswapd context to the allocation being done > by the workqueue, so that memory reclaim understands correctly that > the work is being done for kswapd and therefore it is not blocked > and does not delay memory reclaim. > > To avoid issues with int->char conversion of flag fields (as noticed > in v1 of this patch) convert the flag fields in the struct > xfs_bmalloca to bool types. pahole indicates these variables are > still single byte variables, so no extra space is consumed by this > change. Looks good, Reviewed-by: Christoph Hellwig _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs