lkml.org 
[lkml]   [2012]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: Disambiguate kernel message
From
Date
On Tue, 2012-01-31 at 12:46 -0800, Arun Sharma wrote:
> On 1/31/12 12:09 PM, Joe Perches wrote:
> >> + too_many_orphans = tcp_too_many_orphans(sk, shift);
> >> + out_of_socket_memory = tcp_out_of_memory(sk);
> >> + tcp_log_oom(too_many_orphans, out_of_socket_memory);
> >> + if (too_many_orphans || out_of_socket_memory) {
> > Perhaps these repeated three lines should be a routine like:
> > bool tcp_check_oom(struct sock *sk, int shift)
> > {
> > bool tcp_orphans = tcp_too_many_orphans(sk, shift);
> > bool tcp_oom = tcp_out_of_memory(sk);
> >
> > printks...
> >
> > return tcp_orphans || tcp_oom;
> > }
> I like your previous suggestion better. It preserves the ability to write:
> if (too_many_orphans) {
> do_something();
> }
> if (out_of_socket_memory) {
> do_something_else();
> }

shrug. That isn't currently used and
tcp_too_many_orphans and tcp_out_of_memory
could still be checked.

I think the routine could be moved out-of-line.



\
 
 \ /
  Last update: 2012-01-31 21:59    [W:0.036 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site