From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gu Zheng Subject: Re: [PATCH] f2fs: introduce f2fs_kmem_cache_alloc to hide the unfailed kmem cache allocation Date: Tue, 22 Oct 2013 13:30:34 +0800 Message-ID: <52660D7A.9070007@cn.fujitsu.com> References: <5264D6C7.9000202@cn.fujitsu.com> <5265F5E6.3000604@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VYUsH-0000vc-Q0 for linux-f2fs-devel@lists.sourceforge.net; Tue, 22 Oct 2013 05:51:25 +0000 Received: from [222.73.24.84] (helo=song.cn.fujitsu.com) by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1VYUsG-0000zl-8o for linux-f2fs-devel@lists.sourceforge.net; Tue, 22 Oct 2013 05:51:25 +0000 In-Reply-To: <5265F5E6.3000604@cn.fujitsu.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Gao feng Cc: fsdevel , linux-kernel , f2fs On 10/22/2013 11:49 AM, Gao feng wrote: > On 10/21/2013 03:24 PM, Gu Zheng wrote: >> +static inline void *f2fs_kmem_cache_alloc(struct kmem_cache *cachep, >> + gfp_t flags) >> +{ >> + void *entry = kmem_cache_alloc(cachep, flags); >> +retry: > > retry after kmem_cache_alloc? Oh~, stupid mistake, thanks for your reminder.:) > >> + if (!entry) { >> + cond_resched(); >> + goto retry; >> + } >> + >> + return entry; >> +} > > -- > 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/ > ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751409Ab3JVFvZ (ORCPT ); Tue, 22 Oct 2013 01:51:25 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:35057 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750874Ab3JVFvW (ORCPT ); Tue, 22 Oct 2013 01:51:22 -0400 X-IronPort-AV: E=Sophos;i="4.93,546,1378828800"; d="scan'208";a="8824072" Message-ID: <52660D7A.9070007@cn.fujitsu.com> Date: Tue, 22 Oct 2013 13:30:34 +0800 From: Gu Zheng User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: Gao feng CC: Kim , f2fs , fsdevel , linux-kernel Subject: Re: [PATCH] f2fs: introduce f2fs_kmem_cache_alloc to hide the unfailed kmem cache allocation References: <5264D6C7.9000202@cn.fujitsu.com> <5265F5E6.3000604@cn.fujitsu.com> In-Reply-To: <5265F5E6.3000604@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/10/22 13:33:49, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/10/22 13:48:48, Serialize complete at 2013/10/22 13:48:48 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/22/2013 11:49 AM, Gao feng wrote: > On 10/21/2013 03:24 PM, Gu Zheng wrote: >> +static inline void *f2fs_kmem_cache_alloc(struct kmem_cache *cachep, >> + gfp_t flags) >> +{ >> + void *entry = kmem_cache_alloc(cachep, flags); >> +retry: > > retry after kmem_cache_alloc? Oh~, stupid mistake, thanks for your reminder.:) > >> + if (!entry) { >> + cond_resched(); >> + goto retry; >> + } >> + >> + return entry; >> +} > > -- > 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/ >