netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
@ 2019-08-13 18:20 Gerd Rausch
  2019-08-13 22:07 ` santosh.shilimkar
  2019-08-14 15:56 ` Doug Ledford
  0 siblings, 2 replies; 20+ messages in thread
From: Gerd Rausch @ 2019-08-13 18:20 UTC (permalink / raw)
  To: Santosh Shilimkar, netdev, linux-rdma, rds-devel; +Cc: David Miller

From: Andy Grover <andy.grover@oracle.com>
Date: Tue, 24 Nov 2009 15:35:51 -0800

Although RDS has an official PF_RDS value now, existing software
expects to look for rds sysctls to determine it. We need to maintain
these for now, for backwards compatibility.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
---
 net/rds/sysctl.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
index e381bbcd9cc1..9760292a0af4 100644
--- a/net/rds/sysctl.c
+++ b/net/rds/sysctl.c
@@ -49,6 +49,13 @@ unsigned int  rds_sysctl_max_unacked_bytes = (16 << 20);
 
 unsigned int rds_sysctl_ping_enable = 1;
 
+/*
+ * We have official values, but must maintain the sysctl interface for existing
+ * software that expects to find these values here.
+ */
+static int rds_sysctl_pf_rds = PF_RDS;
+static int rds_sysctl_sol_rds = SOL_RDS;
+
 static struct ctl_table rds_sysctl_rds_table[] = {
 	{
 		.procname       = "reconnect_min_delay_ms",
@@ -68,6 +75,20 @@ static struct ctl_table rds_sysctl_rds_table[] = {
 		.extra1		= &rds_sysctl_reconnect_min_jiffies,
 		.extra2		= &rds_sysctl_reconnect_max,
 	},
+	{
+		.procname       = "pf_rds",
+		.data		= &rds_sysctl_pf_rds,
+		.maxlen         = sizeof(int),
+		.mode           = 0444,
+		.proc_handler   = &proc_dointvec,
+	},
+	{
+		.procname       = "sol_rds",
+		.data		= &rds_sysctl_sol_rds,
+		.maxlen         = sizeof(int),
+		.mode           = 0444,
+		.proc_handler   = &proc_dointvec,
+	},
 	{
 		.procname	= "max_unacked_packets",
 		.data		= &rds_sysctl_max_unacked_packets,
-- 
2.22.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-13 18:20 [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl Gerd Rausch
@ 2019-08-13 22:07 ` santosh.shilimkar
  2019-08-14 15:56 ` Doug Ledford
  1 sibling, 0 replies; 20+ messages in thread
From: santosh.shilimkar @ 2019-08-13 22:07 UTC (permalink / raw)
  To: Gerd Rausch, netdev, linux-rdma, rds-devel; +Cc: David Miller

On 8/13/19 11:20 AM, Gerd Rausch wrote:
> From: Andy Grover <andy.grover@oracle.com>
> Date: Tue, 24 Nov 2009 15:35:51 -0800
> 
> Although RDS has an official PF_RDS value now, existing software
> expects to look for rds sysctls to determine it. We need to maintain
> these for now, for backwards compatibility.
> 
> Signed-off-by: Andy Grover <andy.grover@oracle.com>
> Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
> ---
Acked-by: Santosh Shilimkar<santosh.shilimkar@oracle.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-13 18:20 [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl Gerd Rausch
  2019-08-13 22:07 ` santosh.shilimkar
@ 2019-08-14 15:56 ` Doug Ledford
  2019-08-14 17:41   ` Gerd Rausch
  2019-08-14 18:01   ` santosh.shilimkar
  1 sibling, 2 replies; 20+ messages in thread
From: Doug Ledford @ 2019-08-14 15:56 UTC (permalink / raw)
  To: Gerd Rausch, Santosh Shilimkar, netdev, linux-rdma, rds-devel
  Cc: David Miller

[-- Attachment #1: Type: text/plain, Size: 2686 bytes --]

On Tue, 2019-08-13 at 11:20 -0700, Gerd Rausch wrote:
> From: Andy Grover <andy.grover@oracle.com>
> Date: Tue, 24 Nov 2009 15:35:51 -0800
> 
> Although RDS has an official PF_RDS value now, existing software
> expects to look for rds sysctls to determine it. We need to maintain
> these for now, for backwards compatibility.
> 
> Signed-off-by: Andy Grover <andy.grover@oracle.com>
> Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
> ---
>  net/rds/sysctl.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
> index e381bbcd9cc1..9760292a0af4 100644
> --- a/net/rds/sysctl.c
> +++ b/net/rds/sysctl.c
> @@ -49,6 +49,13 @@ unsigned int  rds_sysctl_max_unacked_bytes = (16 <<
> 20);
>  
>  unsigned int rds_sysctl_ping_enable = 1;
>  
> +/*
> + * We have official values, but must maintain the sysctl interface
> for existing
> + * software that expects to find these values here.
> + */
> +static int rds_sysctl_pf_rds = PF_RDS;
> +static int rds_sysctl_sol_rds = SOL_RDS;
> +
>  static struct ctl_table rds_sysctl_rds_table[] = {
>  	{
>  		.procname       = "reconnect_min_delay_ms",
> @@ -68,6 +75,20 @@ static struct ctl_table rds_sysctl_rds_table[] = {
>  		.extra1		= &rds_sysctl_reconnect_min_jiffies,
>  		.extra2		= &rds_sysctl_reconnect_max,
>  	},
> +	{
> +		.procname       = "pf_rds",
> +		.data		= &rds_sysctl_pf_rds,
> +		.maxlen         = sizeof(int),
> +		.mode           = 0444,
> +		.proc_handler   = &proc_dointvec,
> +	},
> +	{
> +		.procname       = "sol_rds",
> +		.data		= &rds_sysctl_sol_rds,
> +		.maxlen         = sizeof(int),
> +		.mode           = 0444,
> +		.proc_handler   = &proc_dointvec,
> +	},
>  	{
>  		.procname	= "max_unacked_packets",
>  		.data		= &rds_sysctl_max_unacked_packets,

Good Lord...RDS was taken into the kernel in Feb of 2009, so over 10
years ago.  The patch to put PF_RDS/AF_RDS/SOL_RDS was taken into
include/linux/socket.h Feb 26, 2009.  The RDS ports were allocated by
IANA on Feb 27 and May 20, 2009.  And you *still* have software that
needs this?  The only software that has ever used RDS was Oracle
software.  I would have expected you guys to update your source code to
do the right thing long before now.  In fact, I would expect you were
ready to retire all of the legacy software that needs this by now.  As
of today, does your current build of Oracle software still require this,
or have you at least fixed it up in your modern builds?

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-14 15:56 ` Doug Ledford
@ 2019-08-14 17:41   ` Gerd Rausch
  2019-08-14 18:01   ` santosh.shilimkar
  1 sibling, 0 replies; 20+ messages in thread
From: Gerd Rausch @ 2019-08-14 17:41 UTC (permalink / raw)
  To: Doug Ledford, Santosh Shilimkar, netdev, linux-rdma, rds-devel
  Cc: David Miller

Hi Doug,

On 14/08/2019 08.56, Doug Ledford wrote:
> Good Lord...RDS was taken into the kernel in Feb of 2009, so over 10
> years ago.  The patch to put PF_RDS/AF_RDS/SOL_RDS was taken into
> include/linux/socket.h Feb 26, 2009.  The RDS ports were allocated by
> IANA on Feb 27 and May 20, 2009.  And you *still* have software that
> needs this?

I'll let Santosh elaborate on this, but it looks like we (i.e. Oracle) do:

From our Gerrit, posted on Aug 08, 2019, 10:39:29 AM UTC-07:00:
--------%<--------%<--------%<--------%<--------%<--------%<--------
Santosh Shilimkar Acked-by +1
Patch Set 1: Acked-by+1
Unfortunately we need to keep these around.
--------%<--------%<--------%<--------%<--------%<--------%<--------

> As of today, does your current build of Oracle software still require this,
> or have you at least fixed it up in your modern builds?
> 

I'll let Santosh answer that question as well.

Thanks,

  Gerd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-14 15:56 ` Doug Ledford
  2019-08-14 17:41   ` Gerd Rausch
@ 2019-08-14 18:01   ` santosh.shilimkar
  2019-08-14 18:21     ` David Miller
  1 sibling, 1 reply; 20+ messages in thread
From: santosh.shilimkar @ 2019-08-14 18:01 UTC (permalink / raw)
  To: Doug Ledford, Gerd Rausch, netdev, linux-rdma, rds-devel; +Cc: David Miller



On 8/14/19 8:56 AM, Doug Ledford wrote:
> On Tue, 2019-08-13 at 11:20 -0700, Gerd Rausch wrote:
>> From: Andy Grover <andy.grover@oracle.com>
>> Date: Tue, 24 Nov 2009 15:35:51 -0800
>>
>> Although RDS has an official PF_RDS value now, existing software
>> expects to look for rds sysctls to determine it. We need to maintain
>> these for now, for backwards compatibility.
>>
>> Signed-off-by: Andy Grover <andy.grover@oracle.com>
>> Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
>> ---
>>   net/rds/sysctl.c | 21 +++++++++++++++++++++
>>   1 file changed, 21 insertions(+)
>>
>> diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
>> index e381bbcd9cc1..9760292a0af4 100644
>> --- a/net/rds/sysctl.c
>> +++ b/net/rds/sysctl.c
>> @@ -49,6 +49,13 @@ unsigned int  rds_sysctl_max_unacked_bytes = (16 <<
>> 20);
>>   
>>   unsigned int rds_sysctl_ping_enable = 1;
>>   
>> +/*
>> + * We have official values, but must maintain the sysctl interface
>> for existing
>> + * software that expects to find these values here.
>> + */
>> +static int rds_sysctl_pf_rds = PF_RDS;
>> +static int rds_sysctl_sol_rds = SOL_RDS;
>> +
>>   static struct ctl_table rds_sysctl_rds_table[] = {
>>   	{
>>   		.procname       = "reconnect_min_delay_ms",
>> @@ -68,6 +75,20 @@ static struct ctl_table rds_sysctl_rds_table[] = {
>>   		.extra1		= &rds_sysctl_reconnect_min_jiffies,
>>   		.extra2		= &rds_sysctl_reconnect_max,
>>   	},
>> +	{
>> +		.procname       = "pf_rds",
>> +		.data		= &rds_sysctl_pf_rds,
>> +		.maxlen         = sizeof(int),
>> +		.mode           = 0444,
>> +		.proc_handler   = &proc_dointvec,
>> +	},
>> +	{
>> +		.procname       = "sol_rds",
>> +		.data		= &rds_sysctl_sol_rds,
>> +		.maxlen         = sizeof(int),
>> +		.mode           = 0444,
>> +		.proc_handler   = &proc_dointvec,
>> +	},
>>   	{
>>   		.procname	= "max_unacked_packets",
>>   		.data		= &rds_sysctl_max_unacked_packets,
> 
> Good Lord...RDS was taken into the kernel in Feb of 2009, so over 10
> years ago.  The patch to put PF_RDS/AF_RDS/SOL_RDS was taken into
> include/linux/socket.h Feb 26, 2009.  The RDS ports were allocated by
> IANA on Feb 27 and May 20, 2009.  And you *still* have software that
> needs this?  The only software that has ever used RDS was Oracle
> software.  I would have expected you guys to update your source code to
> do the right thing long before now.  In fact, I would expect you were
> ready to retire all of the legacy software that needs this by now.  As
> of today, does your current build of Oracle software still require this,
> or have you at least fixed it up in your modern builds?
> 
Some of the application software was released before 2009 and ended up
using these proc entries from downstream kernel. The newer lib/app
using RDS don't use these. Unfortunately lot of customer still use
Oracle 9, 10, 11 which were released before 2007 and run these apps
on modern kernels.

Regards,
Snatosh

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-14 18:01   ` santosh.shilimkar
@ 2019-08-14 18:21     ` David Miller
  2019-08-14 18:36       ` santosh.shilimkar
  0 siblings, 1 reply; 20+ messages in thread
From: David Miller @ 2019-08-14 18:21 UTC (permalink / raw)
  To: santosh.shilimkar; +Cc: dledford, gerd.rausch, netdev, linux-rdma, rds-devel

From: santosh.shilimkar@oracle.com
Date: Wed, 14 Aug 2019 11:01:36 -0700

> Some of the application software was released before 2009 and ended up
> using these proc entries from downstream kernel. The newer lib/app
> using RDS don't use these. Unfortunately lot of customer still use
> Oracle 9, 10, 11 which were released before 2007 and run these apps
> on modern kernels.

So those apps are using proc entries that were never upstream...

Sorry, this is completely and utterly inappropriate.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-14 18:21     ` David Miller
@ 2019-08-14 18:36       ` santosh.shilimkar
  2019-08-14 21:31         ` David Miller
  0 siblings, 1 reply; 20+ messages in thread
From: santosh.shilimkar @ 2019-08-14 18:36 UTC (permalink / raw)
  To: David Miller; +Cc: dledford, gerd.rausch, netdev, linux-rdma, rds-devel

On 8/14/19 11:21 AM, David Miller wrote:
> From: santosh.shilimkar@oracle.com
> Date: Wed, 14 Aug 2019 11:01:36 -0700
> 
>> Some of the application software was released before 2009 and ended up
>> using these proc entries from downstream kernel. The newer lib/app
>> using RDS don't use these. Unfortunately lot of customer still use
>> Oracle 9, 10, 11 which were released before 2007 and run these apps
>> on modern kernels.
> 
> So those apps are using proc entries that were never upstream...
>
> Sorry, this is completely and utterly inappropriate.
> 
Agree. Unfortunately one of the legacy application library didn't
get upgraded even after the ports were registered with IANA.
Oracle 11 is still very active release and hence this patch.

It is fine to drop $subject patch from this series.

Regards,
Santosh




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-14 18:36       ` santosh.shilimkar
@ 2019-08-14 21:31         ` David Miller
  2019-08-14 21:45           ` Gerd Rausch
  0 siblings, 1 reply; 20+ messages in thread
From: David Miller @ 2019-08-14 21:31 UTC (permalink / raw)
  To: santosh.shilimkar; +Cc: dledford, gerd.rausch, netdev, linux-rdma, rds-devel

From: santosh.shilimkar@oracle.com
Date: Wed, 14 Aug 2019 11:36:19 -0700

> On 8/14/19 11:21 AM, David Miller wrote:
>> From: santosh.shilimkar@oracle.com
>> Date: Wed, 14 Aug 2019 11:01:36 -0700
>> 
>>> Some of the application software was released before 2009 and ended up
>>> using these proc entries from downstream kernel. The newer lib/app
>>> using RDS don't use these. Unfortunately lot of customer still use
>>> Oracle 9, 10, 11 which were released before 2007 and run these apps
>>> on modern kernels.
>> So those apps are using proc entries that were never upstream...
>>
>> Sorry, this is completely and utterly inappropriate.
>> 
> Agree. Unfortunately one of the legacy application library didn't
> get upgraded even after the ports were registered with IANA.
> Oracle 11 is still very active release and hence this patch.
> 
> It is fine to drop $subject patch from this series.

The appropriate procedure is to resubmit the series with the patch
removed.

Thank you.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-14 21:31         ` David Miller
@ 2019-08-14 21:45           ` Gerd Rausch
  2019-08-15  1:25             ` David Miller
  0 siblings, 1 reply; 20+ messages in thread
From: Gerd Rausch @ 2019-08-14 21:45 UTC (permalink / raw)
  To: David Miller, santosh.shilimkar; +Cc: dledford, netdev, linux-rdma, rds-devel

Hi David,

On 14/08/2019 14.31, David Miller wrote:
> From: santosh.shilimkar@oracle.com
> Date: Wed, 14 Aug 2019 11:36:19 -0700
> 
>> On 8/14/19 11:21 AM, David Miller wrote:
>>> From: santosh.shilimkar@oracle.com
>>> Date: Wed, 14 Aug 2019 11:01:36 -0700
>>>
>>>> Some of the application software was released before 2009 and ended up
>>>> using these proc entries from downstream kernel. The newer lib/app
>>>> using RDS don't use these. Unfortunately lot of customer still use
>>>> Oracle 9, 10, 11 which were released before 2007 and run these apps
>>>> on modern kernels.
>>> So those apps are using proc entries that were never upstream...
>>>
>>> Sorry, this is completely and utterly inappropriate.
>>>
>> Agree. Unfortunately one of the legacy application library didn't
>> get upgraded even after the ports were registered with IANA.
>> Oracle 11 is still very active release and hence this patch.
>>
>> It is fine to drop $subject patch from this series.
> 
> The appropriate procedure is to resubmit the series with the patch
> removed.
> 

For my understanding:
Are you saying that...

a) It is utterly inappropriate to have Oracle applications
   rely on a /proc/sys API that was kept out of Upstream-Linux
   for this long

b) It is utterly inappropriate to include such a /proc/sys API
   that Oracle applications have depended on this late

c) ... something else ...

At first I read your comment as "a)", which would then imply
that this commit shall be included now (albeit late).

If your answer is "not a)", or implies that Oracle ought to continue
to carry this change in our own repository only, please let me know,
and I will re-submit the series without this patch, to follow
appropriate procedure.

Thanks,

  Gerd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl
  2019-08-14 21:45           ` Gerd Rausch
@ 2019-08-15  1:25             ` David Miller
  2019-08-15 14:40               ` [PATCH net-next v2 0/4] net/rds: Fixes from internal Oracle repo Gerd Rausch
       [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
  0 siblings, 2 replies; 20+ messages in thread
From: David Miller @ 2019-08-15  1:25 UTC (permalink / raw)
  To: gerd.rausch; +Cc: santosh.shilimkar, dledford, netdev, linux-rdma, rds-devel

From: Gerd Rausch <gerd.rausch@oracle.com>
Date: Wed, 14 Aug 2019 14:45:21 -0700

> a) It is utterly inappropriate to have Oracle applications
>    rely on a /proc/sys API that was kept out of Upstream-Linux
>    for this long

Yes.

> 
> b) It is utterly inappropriate to include such a /proc/sys API
>    that Oracle applications have depended on this late

Also yes.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH net-next v2 0/4] net/rds: Fixes from internal Oracle repo
  2019-08-15  1:25             ` David Miller
@ 2019-08-15 14:40               ` Gerd Rausch
  2019-08-15 19:04                 ` David Miller
       [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
  1 sibling, 1 reply; 20+ messages in thread
From: Gerd Rausch @ 2019-08-15 14:40 UTC (permalink / raw)
  To: Santosh Shilimkar, netdev, linux-rdma, rds-devel; +Cc: David Miller

This is the first set of (mostly old) patches from our internal repository
in an effort to synchronize what Oracle had been using internally
with what is shipped with the Linux kernel.

Andy Grover (1):
  rds: check for excessive looping in rds_send_xmit

Chris Mason (2):
  RDS: limit the number of times we loop in rds_send_xmit
  RDS: don't use GFP_ATOMIC for sk_alloc in rds_create

Gerd Rausch (1):
  net/rds: Add a few missing rds_stat_names entries

 net/rds/af_rds.c  |  2 +-
 net/rds/ib_recv.c | 12 +++++++++++-
 net/rds/rds.h     |  2 +-
 net/rds/send.c    | 12 ++++++++++++
 net/rds/stats.c   |  3 +++
 5 files changed, 28 insertions(+), 3 deletions(-)

-- 

Changes in submitted patch v2:
* Dropped the controversial "sysctl" patch:
  https://lore.kernel.org/netdev/20190814.142112.1080694155114782651.davem@davemloft.net/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH net-next v2 1/4] RDS: limit the number of times we loop in rds_send_xmit
       [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
@ 2019-08-15 14:42                 ` Gerd Rausch
  2019-08-15 16:16                   ` santosh.shilimkar
  2019-08-15 14:42                 ` [PATCH net-next v2 2/4] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create Gerd Rausch
                                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 20+ messages in thread
From: Gerd Rausch @ 2019-08-15 14:42 UTC (permalink / raw)
  To: Santosh Shilimkar, netdev, linux-rdma, rds-devel; +Cc: David Miller

From: Chris Mason <chris.mason@oracle.com>
Date: Fri, 3 Feb 2012 11:07:54 -0500

This will kick the RDS worker thread if we have been looping
too long.

Original commit from 2012 updated to include a change by
Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
that triggers "must_wake" if "rds_ib_recv_refill_one" fails.

Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
---
 net/rds/ib_recv.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 3cae88cbdaa0..1a8a4a760b84 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -385,6 +385,7 @@ void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp)
 	unsigned int posted = 0;
 	int ret = 0;
 	bool can_wait = !!(gfp & __GFP_DIRECT_RECLAIM);
+	bool must_wake = false;
 	u32 pos;
 
 	/* the goal here is to just make sure that someone, somewhere
@@ -405,6 +406,7 @@ void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp)
 		recv = &ic->i_recvs[pos];
 		ret = rds_ib_recv_refill_one(conn, recv, gfp);
 		if (ret) {
+			must_wake = true;
 			break;
 		}
 
@@ -423,6 +425,11 @@ void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp)
 		}
 
 		posted++;
+
+		if ((posted > 128 && need_resched()) || posted > 8192) {
+			must_wake = true;
+			break;
+		}
 	}
 
 	/* We're doing flow control - update the window. */
@@ -445,10 +452,13 @@ void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp)
 	 * if we should requeue.
 	 */
 	if (rds_conn_up(conn) &&
-	    ((can_wait && rds_ib_ring_low(&ic->i_recv_ring)) ||
+	    (must_wake ||
+	    (can_wait && rds_ib_ring_low(&ic->i_recv_ring)) ||
 	    rds_ib_ring_empty(&ic->i_recv_ring))) {
 		queue_delayed_work(rds_wq, &conn->c_recv_w, 1);
 	}
+	if (can_wait)
+		cond_resched();
 }
 
 /*
-- 
2.22.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net-next v2 2/4] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create
       [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
  2019-08-15 14:42                 ` [PATCH net-next v2 1/4] RDS: limit the number of times we loop in rds_send_xmit Gerd Rausch
@ 2019-08-15 14:42                 ` Gerd Rausch
  2019-08-15 16:17                   ` santosh.shilimkar
  2019-08-15 14:42                 ` [PATCH net-next v2 3/4] net/rds: Add a few missing rds_stat_names entries Gerd Rausch
  2019-08-15 14:43                 ` [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit Gerd Rausch
  3 siblings, 1 reply; 20+ messages in thread
From: Gerd Rausch @ 2019-08-15 14:42 UTC (permalink / raw)
  To: Santosh Shilimkar, netdev, linux-rdma, rds-devel; +Cc: David Miller

From: Chris Mason <chris.mason@oracle.com>
Date: Fri, 3 Feb 2012 11:08:51 -0500

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
---
 net/rds/af_rds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 2b969f99ef13..7228892046cf 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -705,7 +705,7 @@ static int rds_create(struct net *net, struct socket *sock, int protocol,
 	if (sock->type != SOCK_SEQPACKET || protocol)
 		return -ESOCKTNOSUPPORT;
 
-	sk = sk_alloc(net, AF_RDS, GFP_ATOMIC, &rds_proto, kern);
+	sk = sk_alloc(net, AF_RDS, GFP_KERNEL, &rds_proto, kern);
 	if (!sk)
 		return -ENOMEM;
 
-- 
2.22.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net-next v2 3/4] net/rds: Add a few missing rds_stat_names entries
       [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
  2019-08-15 14:42                 ` [PATCH net-next v2 1/4] RDS: limit the number of times we loop in rds_send_xmit Gerd Rausch
  2019-08-15 14:42                 ` [PATCH net-next v2 2/4] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create Gerd Rausch
@ 2019-08-15 14:42                 ` Gerd Rausch
  2019-08-15 16:17                   ` santosh.shilimkar
  2019-08-15 14:43                 ` [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit Gerd Rausch
  3 siblings, 1 reply; 20+ messages in thread
From: Gerd Rausch @ 2019-08-15 14:42 UTC (permalink / raw)
  To: Santosh Shilimkar, netdev, linux-rdma, rds-devel; +Cc: David Miller

From: Gerd Rausch <gerd.rausch@oracle.com>
Date: Thu, 11 Jul 2019 12:15:50 -0700

In a previous commit, fields were added to "struct rds_statistics"
but array "rds_stat_names" was not updated accordingly.

Please note the inconsistent naming of the string representations
that is done in the name of compatibility
with the Oracle internal code-base.

s_recv_bytes_added_to_socket     -> "recv_bytes_added_to_sock"
s_recv_bytes_removed_from_socket -> "recv_bytes_freed_fromsock"

Fixes: 192a798f5299 ("RDS: add stat for socket recv memory usage")
Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
---
 net/rds/stats.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/rds/stats.c b/net/rds/stats.c
index 73be187d389e..6bbab4d74c4f 100644
--- a/net/rds/stats.c
+++ b/net/rds/stats.c
@@ -76,6 +76,8 @@ static const char *const rds_stat_names[] = {
 	"cong_update_received",
 	"cong_send_error",
 	"cong_send_blocked",
+	"recv_bytes_added_to_sock",
+	"recv_bytes_freed_fromsock",
 };
 
 void rds_stats_info_copy(struct rds_info_iterator *iter,
-- 
2.22.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit
       [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
                                   ` (2 preceding siblings ...)
  2019-08-15 14:42                 ` [PATCH net-next v2 3/4] net/rds: Add a few missing rds_stat_names entries Gerd Rausch
@ 2019-08-15 14:43                 ` Gerd Rausch
  2019-08-15 16:18                   ` santosh.shilimkar
  3 siblings, 1 reply; 20+ messages in thread
From: Gerd Rausch @ 2019-08-15 14:43 UTC (permalink / raw)
  To: Santosh Shilimkar, netdev, linux-rdma, rds-devel; +Cc: David Miller

From: Andy Grover <andy.grover@oracle.com>
Date: Thu, 13 Jan 2011 11:40:31 -0800

Original commit from 2011 updated to include a change by
Yuval Shaia <yuval.shaia@oracle.com>
that adds a new statistic counter "send_stuck_rm"
to capture the messages looping exessively
in the send path.

Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
---
 net/rds/rds.h   |  2 +-
 net/rds/send.c  | 12 ++++++++++++
 net/rds/stats.c |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/net/rds/rds.h b/net/rds/rds.h
index f0066d168499..ad605fd61655 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -717,7 +717,7 @@ struct rds_statistics {
 	uint64_t	s_cong_send_blocked;
 	uint64_t	s_recv_bytes_added_to_socket;
 	uint64_t	s_recv_bytes_removed_from_socket;
-
+	uint64_t	s_send_stuck_rm;
 };
 
 /* af_rds.c */
diff --git a/net/rds/send.c b/net/rds/send.c
index 031b1e97a466..9ce552abf9e9 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -145,6 +145,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
 	LIST_HEAD(to_be_dropped);
 	int batch_count;
 	unsigned long send_gen = 0;
+	int same_rm = 0;
 
 restart:
 	batch_count = 0;
@@ -200,6 +201,17 @@ int rds_send_xmit(struct rds_conn_path *cp)
 
 		rm = cp->cp_xmit_rm;
 
+		if (!rm) {
+			same_rm = 0;
+		} else {
+			same_rm++;
+			if (same_rm >= 4096) {
+				rds_stats_inc(s_send_stuck_rm);
+				ret = -EAGAIN;
+				break;
+			}
+		}
+
 		/*
 		 * If between sending messages, we can send a pending congestion
 		 * map update.
diff --git a/net/rds/stats.c b/net/rds/stats.c
index 6bbab4d74c4f..9e87da43c004 100644
--- a/net/rds/stats.c
+++ b/net/rds/stats.c
@@ -78,6 +78,7 @@ static const char *const rds_stat_names[] = {
 	"cong_send_blocked",
 	"recv_bytes_added_to_sock",
 	"recv_bytes_freed_fromsock",
+	"send_stuck_rm",
 };
 
 void rds_stats_info_copy(struct rds_info_iterator *iter,
-- 
2.22.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next v2 1/4] RDS: limit the number of times we loop in rds_send_xmit
  2019-08-15 14:42                 ` [PATCH net-next v2 1/4] RDS: limit the number of times we loop in rds_send_xmit Gerd Rausch
@ 2019-08-15 16:16                   ` santosh.shilimkar
  0 siblings, 0 replies; 20+ messages in thread
From: santosh.shilimkar @ 2019-08-15 16:16 UTC (permalink / raw)
  To: Gerd Rausch, netdev, linux-rdma, rds-devel; +Cc: David Miller

On 8/15/19 7:42 AM, Gerd Rausch wrote:
> From: Chris Mason <chris.mason@oracle.com>
> Date: Fri, 3 Feb 2012 11:07:54 -0500
> 
> This will kick the RDS worker thread if we have been looping
> too long.
> 
> Original commit from 2012 updated to include a change by
> Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
> that triggers "must_wake" if "rds_ib_recv_refill_one" fails.
> 
> Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
> ---
Thought I acked V1 series.

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next v2 2/4] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create
  2019-08-15 14:42                 ` [PATCH net-next v2 2/4] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create Gerd Rausch
@ 2019-08-15 16:17                   ` santosh.shilimkar
  0 siblings, 0 replies; 20+ messages in thread
From: santosh.shilimkar @ 2019-08-15 16:17 UTC (permalink / raw)
  To: Gerd Rausch, netdev, linux-rdma, rds-devel; +Cc: David Miller

On 8/15/19 7:42 AM, Gerd Rausch wrote:
> From: Chris Mason <chris.mason@oracle.com>
> Date: Fri, 3 Feb 2012 11:08:51 -0500
> 
> Signed-off-by: Chris Mason <chris.mason@oracle.com>
> Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
> Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
> Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next v2 3/4] net/rds: Add a few missing rds_stat_names entries
  2019-08-15 14:42                 ` [PATCH net-next v2 3/4] net/rds: Add a few missing rds_stat_names entries Gerd Rausch
@ 2019-08-15 16:17                   ` santosh.shilimkar
  0 siblings, 0 replies; 20+ messages in thread
From: santosh.shilimkar @ 2019-08-15 16:17 UTC (permalink / raw)
  To: Gerd Rausch, netdev, linux-rdma, rds-devel; +Cc: David Miller

On 8/15/19 7:42 AM, Gerd Rausch wrote:
> From: Gerd Rausch <gerd.rausch@oracle.com>
> Date: Thu, 11 Jul 2019 12:15:50 -0700
> 
> In a previous commit, fields were added to "struct rds_statistics"
> but array "rds_stat_names" was not updated accordingly.
> 
> Please note the inconsistent naming of the string representations
> that is done in the name of compatibility
> with the Oracle internal code-base.
> 
> s_recv_bytes_added_to_socket     -> "recv_bytes_added_to_sock"
> s_recv_bytes_removed_from_socket -> "recv_bytes_freed_fromsock"
> 
> Fixes: 192a798f5299 ("RDS: add stat for socket recv memory usage")
> Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit
  2019-08-15 14:43                 ` [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit Gerd Rausch
@ 2019-08-15 16:18                   ` santosh.shilimkar
  0 siblings, 0 replies; 20+ messages in thread
From: santosh.shilimkar @ 2019-08-15 16:18 UTC (permalink / raw)
  To: Gerd Rausch, netdev, linux-rdma, rds-devel; +Cc: David Miller

On 8/15/19 7:43 AM, Gerd Rausch wrote:
> From: Andy Grover <andy.grover@oracle.com>
> Date: Thu, 13 Jan 2011 11:40:31 -0800
> 
> Original commit from 2011 updated to include a change by
> Yuval Shaia <yuval.shaia@oracle.com>
> that adds a new statistic counter "send_stuck_rm"
> to capture the messages looping exessively
> in the send path.
> 
> Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net-next v2 0/4] net/rds: Fixes from internal Oracle repo
  2019-08-15 14:40               ` [PATCH net-next v2 0/4] net/rds: Fixes from internal Oracle repo Gerd Rausch
@ 2019-08-15 19:04                 ` David Miller
  0 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2019-08-15 19:04 UTC (permalink / raw)
  To: gerd.rausch; +Cc: santosh.shilimkar, netdev, linux-rdma, rds-devel

From: Gerd Rausch <gerd.rausch@oracle.com>
Date: Thu, 15 Aug 2019 07:40:22 -0700

> This is the first set of (mostly old) patches from our internal repository
> in an effort to synchronize what Oracle had been using internally
> with what is shipped with the Linux kernel.

Series applied.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-08-15 19:04 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 18:20 [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl Gerd Rausch
2019-08-13 22:07 ` santosh.shilimkar
2019-08-14 15:56 ` Doug Ledford
2019-08-14 17:41   ` Gerd Rausch
2019-08-14 18:01   ` santosh.shilimkar
2019-08-14 18:21     ` David Miller
2019-08-14 18:36       ` santosh.shilimkar
2019-08-14 21:31         ` David Miller
2019-08-14 21:45           ` Gerd Rausch
2019-08-15  1:25             ` David Miller
2019-08-15 14:40               ` [PATCH net-next v2 0/4] net/rds: Fixes from internal Oracle repo Gerd Rausch
2019-08-15 19:04                 ` David Miller
     [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
2019-08-15 14:42                 ` [PATCH net-next v2 1/4] RDS: limit the number of times we loop in rds_send_xmit Gerd Rausch
2019-08-15 16:16                   ` santosh.shilimkar
2019-08-15 14:42                 ` [PATCH net-next v2 2/4] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create Gerd Rausch
2019-08-15 16:17                   ` santosh.shilimkar
2019-08-15 14:42                 ` [PATCH net-next v2 3/4] net/rds: Add a few missing rds_stat_names entries Gerd Rausch
2019-08-15 16:17                   ` santosh.shilimkar
2019-08-15 14:43                 ` [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit Gerd Rausch
2019-08-15 16:18                   ` santosh.shilimkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).