From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756807AbdEYInE (ORCPT ); Thu, 25 May 2017 04:43:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33222 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756764AbdEYInB (ORCPT ); Thu, 25 May 2017 04:43:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 46417C057FAD Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ming.lei@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 46417C057FAD Date: Thu, 25 May 2017 16:42:44 +0800 From: Ming Lei To: "Huang, Ying" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Minchan Kim , Jens Axboe , Ming Lei , Shaohua Li , linux-block@vger.kernel.org Subject: Re: [PATCH -mm 06/13] block: Increase BIO_MAX_PAGES to PMD size if THP_SWAP enabled Message-ID: <20170525084238.GA15737@ming.t460p> References: <20170525064635.2832-1-ying.huang@intel.com> <20170525064635.2832-7-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170525064635.2832-7-ying.huang@intel.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 25 May 2017 08:43:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 25, 2017 at 02:46:28PM +0800, Huang, Ying wrote: > From: Huang Ying > > In this patch, BIO_MAX_PAGES is changed from 256 to HPAGE_PMD_NR if > CONFIG_THP_SWAP is enabled and HPAGE_PMD_NR > 256. This is to support > THP (Transparent Huge Page) swap optimization. Where the THP will be > write to disk as a whole instead of HPAGE_PMD_NR normal pages to batch > the various operations during swap. And the page is likely to be > written to disk to free memory when system memory goes really low, the > memory pool need to be used to avoid deadlock. > > Signed-off-by: "Huang, Ying" > Cc: Johannes Weiner > Cc: Minchan Kim > Cc: Jens Axboe > Cc: Ming Lei > Cc: Shaohua Li > Cc: linux-block@vger.kernel.org > --- > include/linux/bio.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/linux/bio.h b/include/linux/bio.h > index d1b04b0e99cf..314796486507 100644 > --- a/include/linux/bio.h > +++ b/include/linux/bio.h > @@ -38,7 +38,15 @@ > #define BIO_BUG_ON > #endif > > +#ifdef CONFIG_THP_SWAP > +#if HPAGE_PMD_NR > 256 > +#define BIO_MAX_PAGES HPAGE_PMD_NR > +#else > #define BIO_MAX_PAGES 256 > +#endif > +#else > +#define BIO_MAX_PAGES 256 > +#endif > > #define bio_prio(bio) (bio)->bi_ioprio > #define bio_set_prio(bio, prio) ((bio)->bi_ioprio = prio) Last time we discussed we should use multipage bvec for this usage. I will rebase the last post on v4.12-rc and kick if off again since the raid cleanup is just done on v4.11. http://marc.info/?t=148453679000002&r=1&w=2 Thanks, Ming