From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] rds: do not call ->conn_alloc with GFP_KERNEL Date: Tue, 13 Feb 2018 12:04:21 -0500 (EST) Message-ID: <20180213.120421.840213231623736121.davem@davemloft.net> References: <1518478238-164533-1-git-send-email-sowmini.varadhan@oracle.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, santosh.shilimkar@oracle.com, rds-devel@oss.oracle.com To: sowmini.varadhan@oracle.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:41988 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964869AbeBMREY (ORCPT ); Tue, 13 Feb 2018 12:04:24 -0500 In-Reply-To: <1518478238-164533-1-git-send-email-sowmini.varadhan@oracle.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Sowmini Varadhan Date: Mon, 12 Feb 2018 15:30:38 -0800 > diff --git a/net/rds/connection.c b/net/rds/connection.c > index 94e190f..d0f5889 100644 > --- a/net/rds/connection.c > +++ b/net/rds/connection.c > @@ -221,6 +221,8 @@ static void __rds_conn_path_init(struct rds_connection *conn, > conn->c_path[i].cp_index = i; > } > rcu_read_lock(); > + gfp &= ~GFP_KERNEL; > + gfp |= GFP_ATOMIC; > if (rds_destroy_pending(conn)) > ret = -ENETDOWN; > else I'd never seen this kind of gfp masking before, so I did a grep around and the only cases I saw of this kind of usage were for things like GFP_DMA and such. I could not find one case that did it to convert a sleeping into a non- sleeping GFP mask. Let's not over-engineer this. For one thing, whatever allocation bits came down from the callers, we are going to lose here. So just pass straight GFP_ATOMIC into the routines below here instead of the 'gfp' variable. Thanks.