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 Cc: fsdevel , linux-kernel , f2fs To: Gao feng Return-path: In-Reply-To: <5265F5E6.3000604@cn.fujitsu.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net List-Id: linux-fsdevel.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/ > ------------------------------------------------------------------------------ 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