Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119AbbEYKBi (ORCPT ); Mon, 25 May 2015 06:01:38 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:58307 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbbEYKBg (ORCPT ); Mon, 25 May 2015 06:01:36 -0400 X-AuditID: cbfee61a-f79516d000006302-50-5562f2fd0015 From: Chao Yu To: "'Jaegeuk Kim'" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <1432255225-76792-1-git-send-email-jaegeuk@kernel.org> <1432255225-76792-2-git-send-email-jaegeuk@kernel.org> In-reply-to: <1432255225-76792-2-git-send-email-jaegeuk@kernel.org> Subject: RE: [f2fs-dev] [PATCH 2/3] f2fs crypto: use bounce pages from mempool first Date: Mon, 25 May 2015 18:00:47 +0800 Message-id: <00d101d096d1$c7300a50$55901ef0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQJdKe977jpcsxfBz7MsXfiV2x1ECQDkmNqdnGvY/9A= Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKLMWRmVeSWpSXmKPExsVy+t9jAd2/n5JCDR6v17J4sn4Ws8WlRe4W e/aeZLG4vGsOmwOLx6ZVnWweuxd8ZvL4vEkugDmKyyYlNSezLLVI3y6BK6Nh5j32gn6Rit6X Sg2MDwS6GDk5JARMJDZNXsAEYYtJXLi3nq2LkYtDSGARo8SHi9tZIJxXjBI/vnSzg1SxCahI LO/4D9YhIqAm0btvCpjNLJApMaH/BViNkEC1RP/1D2wgNqeAs8SRawdYQGxhgTCJBbd3gdWw CKhK/P/9nBnE5hWwlLi14CWULSjxY/I9FoiZWhLrdx6Hmi8vsXnNW2aISxUkdpx9zQhxg5XE 9s/3GCFqxCU2HrnFMoFRaBaSUbOQjJqFZNQsJC0LGFlWMYqmFiQXFCel5xrqFSfmFpfmpesl 5+duYgQH/jOpHYwrGywOMQpwMCrx8EZkJIUKsSaWFVfmHmKU4GBWEuEN+QgU4k1JrKxKLcqP LyrNSS0+xCjNwaIkznsy3ydUSCA9sSQ1OzW1ILUIJsvEwSnVwMh4acYJJ523c/ccSU21vVkS ESLEdJ711YTHS105ntgrCrH5nHBx6pt4sW/z1pw5cWkhH1YaZKiyL/y6aXKgRUql+v53heYZ 94wmTFkb1CIwQ6B28YWIQrXIqfO1ClUTZNwWZ2t+mXXSZGrwO8ucS61bditNmuklYrs169jj 2SsS+BJCY1Nq+5RYijMSDbWYi4oTAePjEAt4AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2751 Lines: 74 Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Friday, May 22, 2015 8:40 AM > To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org; > linux-f2fs-devel@lists.sourceforge.net > Cc: Jaegeuk Kim > Subject: [f2fs-dev] [PATCH 2/3] f2fs crypto: use bounce pages from mempool first > > If a lot of write streams are triggered, alloc_page and __free_page are > costly called, resulting in high memory pressure. > > In order to avoid that, let's reuse mempool pages for writeback pages. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/crypto.c | 16 ++++------------ > 1 file changed, 4 insertions(+), 12 deletions(-) > > diff --git a/fs/f2fs/crypto.c b/fs/f2fs/crypto.c > index 2c7819a..2ceee68 100644 > --- a/fs/f2fs/crypto.c > +++ b/fs/f2fs/crypto.c > @@ -408,20 +408,12 @@ struct page *f2fs_encrypt(struct inode *inode, > return (struct page *)ctx; > > /* The encryption operation will require a bounce page. */ > - ciphertext_page = alloc_page(GFP_NOFS); > + ciphertext_page = mempool_alloc(f2fs_bounce_page_pool, GFP_NOFS); > if (!ciphertext_page) { > - /* > - * This is a potential bottleneck, but at least we'll have > - * forward progress. > - */ > - ciphertext_page = mempool_alloc(f2fs_bounce_page_pool, > - GFP_NOFS); > - if (WARN_ON_ONCE(!ciphertext_page)) > - ciphertext_page = mempool_alloc(f2fs_bounce_page_pool, > - GFP_NOFS | __GFP_WAIT); > - ctx->flags &= ~F2FS_BOUNCE_PAGE_REQUIRES_FREE_ENCRYPT_FL; > - } else { > + ciphertext_page = alloc_page(GFP_NOFS); Using alloc_page(GFP_NOFS | __GFP_WAIT) to avoid failure? Thanks, > ctx->flags |= F2FS_BOUNCE_PAGE_REQUIRES_FREE_ENCRYPT_FL; > + } else { > + ctx->flags &= ~F2FS_BOUNCE_PAGE_REQUIRES_FREE_ENCRYPT_FL; > } > ctx->flags |= F2FS_WRITE_PATH_FL; > ctx->w.bounce_page = ciphertext_page; > -- > 2.1.1 > > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/