mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: "Makhlis, Lev" <Lev_Makhlis@bmc.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [SYSVIPC] Change shm_tot from int to size_t
Date: Fri, 25 Jun 2004 18:40:10 +0200	[thread overview]
Message-ID: <20040625164010.GA5420@pclin040.win.tue.nl> (raw)
In-Reply-To: <F12B6443B4A38748AFA644D1F8EF3532151078@bos-ex-01.adprod.bmc.com>

On Fri, Jun 25, 2004 at 10:41:13AM -0500, Makhlis, Lev wrote:

> I see that shm_tot (the total number of pages in shm segments) in
> ipc/shm.c is defined as int, even though its max value (shmall) is size_t.
> 
> Admittedly, it only matters for systems with >8TB memory, but shouldn't
> shm_tot also be size_t?  The attached patch makes it so.

> -static int shm_tot; /* total number of shared memory pages */
> +static size_t shm_tot; /* total number of shared memory pages */

First, please avoid attachments.

Secondly, this makes shm_tot unsigned. Have you checked all places
where it occurs in an inequality to see whether the semantics did
change? (It looks OK.)

Thirdly, shm_tot is transmitted to userspace (via the SHM_INFO ioctl)
as an unsigned long. If it is necessary to make it larger, then we
must do something with this ioctl. For example, return -1 there
in case the actual value does not fit in an unsigned long.



  reply	other threads:[~2004-06-25 16:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25 15:41 Makhlis, Lev
2004-06-25 16:40 ` Andries Brouwer [this message]
2004-06-25 17:42 Makhlis, Lev
2004-06-25 20:39 ` Andries Brouwer
2004-06-25 21:56 Makhlis, Lev
2004-06-26  0:14 ` Andries Brouwer
2004-06-28 16:22 Makhlis, Lev

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=20040625164010.GA5420@pclin040.win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=Lev_Makhlis@bmc.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®