public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Lu Fei <lufei@uniontech.com>
Cc: ltp <ltp@lists.linux.it>, viro <viro@zeniv.linux.org.uk>
Subject: Re: [LTP] [PATCH v2] unshare03: set nr_open with sizeof(long)*8
Date: Fri, 11 Apr 2025 11:03:13 +0200	[thread overview]
Message-ID: <Z_ja0Z4IVpCavGmj@yuki.lan> (raw)
In-Reply-To: <E235D2DBCAA80A8D+Z/iwVNmdnxoxZyrN@rocky>

Hi!
> >unsigned int sysctl_nr_open __read_mostly = 1024*1024;
> >unsigned int sysctl_nr_open_min = BITS_PER_LONG;
> >/* our min() is unusable in constant expressions ;-/ */
> >#define __const_min(x, y) ((x) < (y) ? (x) : (y))
> >unsigned int sysctl_nr_open_max =
> >        __const_min(INT_MAX, ~(size_t)0/sizeof(void *)) & -BITS_PER_LONG;
> >...
> 
> >Then we need a filedescriptor that is >= 64 and set the nr_open to 64.
> 
> I'm using sizeof(long)*8 is because I was thinking only set
> filediscriptor >= BITS_PER_LONG and then set nr_open = BITS_PER_LONG
> could make EMFILE happen. Less than BITS_PER_LONG would trigger other 
> error than EMFILE.
> 
> Am I misunderstood Cyril?

The actual patch is fine. What they are asking for is a better
description. The patch description should tell _why_ the change is
needed.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-04-11  9:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14  4:42 [LTP] [PATCH] unshare03: using soft limit of NOFILE lufei
2025-03-27 10:33 ` Petr Vorel
     [not found]   ` <0A99FFBB46DDB0B4+Z+YKSlAwn1vx3Dz4@rocky>
2025-03-28  8:50     ` Petr Vorel
2025-04-01 10:11 ` Cyril Hrubis
2025-04-01 12:54   ` Petr Vorel
2025-04-01 13:55     ` Cyril Hrubis
2025-04-09  6:41   ` Lu Fei
2025-04-09  7:49 ` [LTP] [PATCH v2] unshare03: set nr_open with sizeof(long)*8 lufei
2025-04-10 15:35   ` Jan Stancek via ltp
2025-04-11  3:09   ` Li Wang via ltp
2025-04-11  3:21     ` Li Wang via ltp
2025-04-11  6:01       ` Lu Fei
2025-04-11  9:03         ` Cyril Hrubis [this message]
2025-04-11  9:30   ` [LTP] [PATCH v3] " lufei
2025-04-16  1:55     ` Li Wang via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_ja0Z4IVpCavGmj@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=lufei@uniontech.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox