Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162462AbbKTM36 (ORCPT ); Fri, 20 Nov 2015 07:29:58 -0500 Received: from orbit.nwl.cc ([176.31.251.142]:38234 "EHLO mail.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbbKTM35 (ORCPT ); Fri, 20 Nov 2015 07:29:57 -0500 X-Greylist: delayed 354 seconds by postgrey-1.27 at vger.kernel.org; Fri, 20 Nov 2015 07:29:57 EST Date: Fri, 20 Nov 2015 13:24:01 +0100 From: Phil Sutter To: Xin Long Cc: linux-kernel@vger.kernel.org, network dev , tgraf@suug.ch, herbert@gondor.apana.org.au, davem Subject: Re: rhashtable: how to deal with that rhashtable_lookup_insert_key return -EBUSY Message-ID: <20151120122401.GB16648@orbit.nwl.cc> Mail-Followup-To: Phil Sutter , Xin Long , linux-kernel@vger.kernel.org, network dev , tgraf@suug.ch, herbert@gondor.apana.org.au, davem References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1666 Lines: 38 On Fri, Nov 20, 2015 at 01:14:18PM +0800, Xin Long wrote: > when I use rhashtable_lookup_insert_key, sometimes it will return -EBUSY. > im not sure if there is a good way to workabout it. > or I should just try again and again until it's inserted successfully ? > > I have seen some use in kernel by now, but it seems that no one consider > this issue for their cases. but it indeed exists in my case. > > did I use it incorrectly or something else ? AFAIK, insert returning -EBUSY is a situation users have to be aware of and retry the insert. I sent a patch[1] to fix this in test_rhashtable. That patch though retried in case of -ENOMEM as well, which was considered wrong to do and therefore it wasn't accepted. But in my test runs, -ENOMEM happened quite frequently and it also wasn't a permanent error. For details, see the following discussion[2]. Herbert, did you manage to reproduce the problem meanwhile? If so, was there any progress on fixing rhashtable? Otherwise, I could respin my patch from [1] to cover only -EBUSY case by default and add a parameter to make non-permanent -ENOMEM visible. Cheers, Phil [1]: https://lkml.org/lkml/2015/8/28/197 [2]: https://lkml.org/lkml/2015/8/28/281 > > Thanks. > -- > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- 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/