Thread View: news.software.nntp
7 messages
7 total messages
Started by John F. Morse
Sat, 25 Apr 2009 22:35
Mmap and maximum cycbuffs
Author: John F. Morse
Date: Sat, 25 Apr 2009 22:35
Date: Sat, 25 Apr 2009 22:35
74 lines
4178 bytes
4178 bytes
I have a couple of questions concerning the following
http://www.eyrie.org/~eagle/software/inn/docs-2.4/install.html
cycbuff.conf
cycbuff.conf is only required if CNFS is used. If you aren't using CNFS,
skip this section.
CNFS stores articles in logical objects called metacycbuffs. Each
metacycbuff is in turn composed of one or more physical buffers called
cycbuffs. As articles are written to the metacycbuff, each article is
written to the next cycbuff in the list in a round-robin fashion (unless
sequential mode is specified, in which case each cycbuff is filled
before moving on to the next). This is so that you can distribute the
individual cycbuffs across multiple physical disks and balance the load
between them.
There are two ways to create your cycbuffs:
1. Use a block device directly. This will probably give you the most
speed since it avoids the file system overhead of large files, but
it requires your OS support mmap(2) on a block device. Solaris
supports this, as do late Linux 2.4 kernels. FreeBSD does not at
last report. Also on many PC-based Unixes it is difficult to
create more than eight partitions, which may limit your options.
2. Use a real file on a filesystem. This will probably be a bit
slower than using a block device directly, but it should work on
any Unix system.
If you're having doubts, use option #2; it's easier to set up and should
work regardless of your operating system.
####
Number 3 above wasn't listed: "Ask someone in n.s.n for details." I'm
definitely full of doubts, but I wish to further my knowledge, so please
help where you can.
Q1. How can I determine if my OS supports mmap? I do not find an mmap(2)
man page, and "apt-cache show mmap" returns, "W: Unable to locate
package mmap E: No packages found" when ran. So I guess mmap is not a
"package" but a compiled-in kernel function? I don't find it in /proc
nor /var/log/kern.log nor /var/log/dmesg.
I did locate: http://linux.die.net/man/2/mmap
http://en.wikipedia.org/wiki/Mmap
http://linux.about.com/library/cmd/blcmdl2_mmap.htm
Does anyone know if Debian 3.1 (Sarge 2.4.27-2-386), 4.0 (Etch
2.6.18-6-486) and 5.0 (Lenny 2.6.26-2-686), as well as Ubuntu 8.04
(Hardy Heron 2.6.24-23-generic) support mmap?
Q2. I suspect the eight partitions restriction mentioned above would be
for the maximum four primary partitions on each hard drive, on each PATA
(IDE/EIDE) channel (master and slave, or "device0" and "device1")? What
about doubling this to 16 if a secondary PATA channel is used (two
additional hard drives)?
Q3. Would this restriction of eight partitions still apply if extended
partitions with many logical partitions are used?
Q4. What about SCSI and SATA drives and controller interfaces that can
accommodate more than four devices, or added PCI ATA interfaces?
--
John
No Microsoft, Apple, AT&T, Novell, Trend Micro, nor Ford products were used in the preparation or transmission of this message.
The EULA sounds like it was written by a team of lawyers who want to tell me what I can't do. The GPL sounds like it was written by a human being, who wants me to know what I can do.
Re: Mmap and maximum cycbuffs
Author: Alexander Bartolich
Date: Sat, 25 Apr 2009 23:55
Date: Sat, 25 Apr 2009 23:55
84 lines
4369 bytes
4369 bytes
John F. Morse wrote:
> [...]
> Q1. How can I determine if my OS supports mmap?
- Read the fine manual
- Write, build and run a test program
- Run a program that claims to use mmap(2) under a system call
tracer like strace(1)
> I do not find an mmap(2) man page,
$ man -w mmap
/usr/share/man/man2/mmap.2.gz
$ dpkg -S /usr/share/man/man2/mmap.2.gz
manpages-dev: /usr/share/man/man2/mmap.2.gz
> and "apt-cache show mmap" returns, "W: Unable to locate
> package mmap E: No packages found" when ran.
$ dpkg -L manpages-dev | wc -l
1661
I guess it would exceed the available storage to add the title of
every included man page to the description of package "manpages-dev".
> [...]
> Does anyone know if Debian 3.1 (Sarge 2.4.27-2-386), 4.0 (Etch
> 2.6.18-6-486) and 5.0 (Lenny 2.6.26-2-686), as well as Ubuntu 8.04
> (Hardy Heron 2.6.24-23-generic) support mmap?
The description of cycbuff.conf was apparently written when the
distinction between BSD and System V still mattered. Nowadays
moth mmap (originated on BSD) and shmctl (the alternative design
of System V) are both part of POSIX and provided by any unixoid
system with virtual memory support.
> Q2. I suspect the eight partitions restriction mentioned above would be
> for the maximum four primary partitions on each hard drive,
I suspect the number eight refers to the partition scheme used by
Sun on its SPARC hardware. Once upon a time there was a similar
limit of four on the IBM PC.
> on each PATA (IDE/EIDE) channel (master and slave, or "device0"
> and "device1")? What about doubling this to 16 if a secondary
> PATA channel is used (two additional hard drives)?
The number of disks in the system has nothing to do with the
number of slices that you can partition one such disk into.
> Q3. Would this restriction of eight partitions still apply if extended
> partitions with many logical partitions are used?
You can have an infinite number of logical partitions. However,
the device node scheme of the old Linux IDE driver supports only
63 partitions. The SCSI driver, which is nowadays also used for
IDE and SATA, supports only 15.
> Q4. What about SCSI and SATA drives and controller interfaces that can
> accommodate more than four devices, or added PCI ATA interfaces?
The device node scheme of Linux:
$ vdir /dev/sd*
brw-rw---- 1 root disk 8, 0 2009-04-08 08:03 /dev/sda
brw-rw---- 1 root disk 8, 1 2009-04-08 08:03 /dev/sda1
brw-rw---- 1 root disk 8, 2 2009-04-08 08:03 /dev/sda2
brw-rw---- 1 root disk 8, 3 2009-04-08 08:03 /dev/sda3
brw-rw---- 1 root disk 8, 16 2009-04-08 08:03 /dev/sdb
brw-rw---- 1 root disk 8, 17 2009-04-08 08:03 /dev/sdb1
brw-rw---- 1 root disk 8, 18 2009-04-08 08:03 /dev/sdb2
brw-rw---- 1 root disk 8, 19 2009-04-08 08:03 /dev/sdb3
^ ^^
major device number ---+ |
|
minor device number -------+
You can have 256 / 16 = 16 disks.
Each disk can have 15 partitions.
If you need more, use the logical volume manager (LVM).
--
seq 100 | sed 's/.*/Romani Ite Domum./'
Re: Mmap and maximum cycbuffs
Author: Russ Allbery
Date: Sun, 26 Apr 2009 00:04
Date: Sun, 26 Apr 2009 00:04
36 lines
2740 bytes
2740 bytes
"John F. Morse" <xanadu.bbs@example.invalid> writes:
> Q1. How can I determine if my OS supports mmap? I do not find an
> mmap(2) man page, and "apt-cache show mmap" returns, "W: Unable to
> locate package mmap E: No packages found" when ran. So I guess mmap is
> not a "package" but a compiled-in kernel function?
Right.
> Does anyone know if Debian 3.1 (Sarge 2.4.27-2-386), 4.0 (Etch
> 2.6.18-6-486) and 5.0 (Lenny 2.6.26-2-686), as well as Ubuntu 8.04
> (Hardy Heron 2.6.24-23-generic) support mmap?
It's not mmap in general (which is supported by any modern UNIX
variant), but whether mmap on raw block devices is supported. I believe
this is supported with any current Linux 2.6 version since it was added
late in 2.4, but I'm not sure that you'll find it gives you much in the
way of performance benefits over a large disk file.
> Q2. I suspect the eight partitions restriction mentioned above would
> be for the maximum four primary partitions on each hard drive, on each
> PATA (IDE/EIDE) channel (master and slave, or "device0" and
> "device1")? What about doubling this to 16 if a secondary PATA channel
> is used (two additional hard drives)?
No, it's that you used to only be able to get four primary and four
extended partitions per drive. I think this is fairly obsolete at this
point with extended logical partitions, although I'm not positive. (I
never have any need to create lots of partitions these days, so I
haven't looked.)
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Mmap and maximum cycbuffs
Author: Russ Allbery
Date: Sun, 26 Apr 2009 02:18
Date: Sun, 26 Apr 2009 02:18
16 lines
1762 bytes
1762 bytes
Alexander Bartolich <alexander.bartolich@gmx.at> writes:
> The description of cycbuff.conf was apparently written when the
> distinction between BSD and System V still mattered. Nowadays moth
> mmap (originated on BSD) and shmctl (the alternative design of System
> V) are both part of POSIX and provided by any unixoid system with
> virtual memory support.
mmap of block devices is much, much newer than BSD or System V. For a
long time, Solaris was one of the few OSes that supported it.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Mmap and maximum cycbuffs
Author: John F. Morse
Date: Sun, 26 Apr 2009 02:32
Date: Sun, 26 Apr 2009 02:32
185 lines
7040 bytes
7040 bytes
Alexander Bartolich wrote:
> John F. Morse wrote:
>
>> [...]
>> Q1. How can I determine if my OS supports mmap?
>>
>
> - Read the fine manual
> - Write, build and run a test program
> - Run a program that claims to use mmap(2) under a system call
> tracer like strace(1)
>
>> I do not find an mmap(2) man page,
>>
>
> $ man -w mmap
> /usr/share/man/man2/mmap.2.gz
>
> $ dpkg -S /usr/share/man/man2/mmap.2.gz
> manpages-dev: /usr/share/man/man2/mmap.2.gz
>
john@n1:~$ dpkg -S /usr/share/man/man2/mmap.2.gz
dpkg: /usr/share/man/man2/mmap.2.gz not found.
john@n1:~$ apt-cache policy manpages-dev
manpages-dev:
Installed: (none)
Candidate: 2.77-1
Version table:
2.77-1 0
500 http://us.archive.ubuntu.com hardy/main Packages
Did you click the link I provided to: http://linux.die.net/man/2/mmap ?
>> and "apt-cache show mmap" returns, "W: Unable to locate
>> package mmap E: No packages found" when ran.
>>
>
> $ dpkg -L manpages-dev | wc -l
> 1661
>
> I guess it would exceed the available storage to add the title of
> every included man page to the description of package "manpages-dev".
>
Not really.
john@n100:~$ apt-cache show manpages-dev
Package: manpages-dev
Priority: optional
Section: doc
Installed-Size: 2972
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Martin Schulze <joey@debian.org>
Architecture: all
Source: manpages
Version: 2.77-1
Replaces: glibc-doc (<< 2.3.6-8)
Depends: manpages
Suggests: man-browser
Filename: pool/main/m/manpages/manpages-dev_2.77-1_all.deb
Size: 1357676
MD5sum: f594d31263bd792ac4ecfe1ee37b4284
SHA1: d2e5b902fac3b8610678243c5794e53fbae934fc
SHA256: cb048666d48833a0e164b8060ca45d9ad23695a5f46acd656e68af66df4b1651
Description: Manual pages about using GNU/Linux for development
These man pages describe the Linux programming interface, including
these two sections:
2 = Linux system calls.
3 = Library calls (note that a more comprehensive source of information
may be found in the glibc-doc package).
>> [...]
>> Does anyone know if Debian 3.1 (Sarge 2.4.27-2-386), 4.0 (Etch
>> 2.6.18-6-486) and 5.0 (Lenny 2.6.26-2-686), as well as Ubuntu 8.04
>> (Hardy Heron 2.6.24-23-generic) support mmap?
>>
>
> The description of cycbuff.conf was apparently written when the
> distinction between BSD and System V still mattered. Nowadays
> moth mmap (originated on BSD) and shmctl (the alternative design
> of System V) are both part of POSIX and provided by any unixoid
> system with virtual memory support.
>
But POSIX isn't always POSIX. ;-)
http://en.wikipedia.org/wiki/Posix#POSIX-oriented_operating_systems
>> Q2. I suspect the eight partitions restriction mentioned above would be
>> for the maximum four primary partitions on each hard drive,
>>
>
> I suspect the number eight refers to the partition scheme used by
> Sun on its SPARC hardware. Once upon a time there was a similar
> limit of four on the IBM PC.
>
There still is the limit. However, "modern" OS software can work around it.
>> on each PATA (IDE/EIDE) channel (master and slave, or "device0"
>> and "device1")? What about doubling this to 16 if a secondary
>> PATA channel is used (two additional hard drives)?
>>
>
> The number of disks in the system has nothing to do with the
> number of slices that you can partition one such disk into.
>
That was not my question.
>> Q3. Would this restriction of eight partitions still apply if extended
>> partitions with many logical partitions are used?
>>
>
> You can have an infinite number of logical partitions. However,
> the device node scheme of the old Linux IDE driver supports only
> 63 partitions. The SCSI driver, which is nowadays also used for
> IDE and SATA, supports only 15.
>
That's 15 drives on EACH SCSI interface card. More cards = more drives. ;-)
Still, you wandered off track from my question about the eight partition
restriction.
>> Q4. What about SCSI and SATA drives and controller interfaces that can
>> accommodate more than four devices, or added PCI ATA interfaces?
>>
>
> The device node scheme of Linux:
>
> $ vdir /dev/sd*
> brw-rw---- 1 root disk 8, 0 2009-04-08 08:03 /dev/sda
> brw-rw---- 1 root disk 8, 1 2009-04-08 08:03 /dev/sda1
> brw-rw---- 1 root disk 8, 2 2009-04-08 08:03 /dev/sda2
> brw-rw---- 1 root disk 8, 3 2009-04-08 08:03 /dev/sda3
> brw-rw---- 1 root disk 8, 16 2009-04-08 08:03 /dev/sdb
> brw-rw---- 1 root disk 8, 17 2009-04-08 08:03 /dev/sdb1
> brw-rw---- 1 root disk 8, 18 2009-04-08 08:03 /dev/sdb2
> brw-rw---- 1 root disk 8, 19 2009-04-08 08:03 /dev/sdb3
> ^ ^^
> major device number ---+ |
> |
> minor device number -------+
>
> You can have 256 / 16 = 16 disks.
> Each disk can have 15 partitions.
> If you need more, use the logical volume manager (LVM).
>
Thanks, Alexander, but I wasn't needing a hardware lesson. ;-)
Maybe my question(s) was (were) unclear?
I asked if the restriction was still valid because of a software
inability to work with more than eight partitions -- of whatever type.
I think I have the answer: Try it and let the expert computer answer the
question. It is up-to-date, which is often not the case at all
concerning documentation. ;-)
--
John
No Microsoft, Apple, AT&T, Novell, Trend Micro, nor Ford products were used in the preparation or transmission of this message.
The EULA sounds like it was written by a team of lawyers who want to tell me what I can't do. The GPL sounds like it was written by a human being, who wants me to know what I can do.
Re: Mmap and maximum cycbuffs
Author: John F. Morse
Date: Sun, 26 Apr 2009 02:33
Date: Sun, 26 Apr 2009 02:33
108 lines
5898 bytes
5898 bytes
Russ Allbery wrote: > "John F. Morse" <xanadu.bbs@example.invalid> writes: > >> Q1. How can I determine if my OS supports mmap? I do not find an >> mmap(2) man page, and "apt-cache show mmap" returns, "W: Unable to >> locate package mmap E: No packages found" when ran. So I guess mmap is >> not a "package" but a compiled-in kernel function? >> > > Right. > >> Does anyone know if Debian 3.1 (Sarge 2.4.27-2-386), 4.0 (Etch >> 2.6.18-6-486) and 5.0 (Lenny 2.6.26-2-686), as well as Ubuntu 8.04 >> (Hardy Heron 2.6.24-23-generic) support mmap? >> > > It's not mmap in general (which is supported by any modern UNIX > variant), but whether mmap on raw block devices is supported. I believe > this is supported with any current Linux 2.6 version since it was added > late in 2.4, but I'm not sure that you'll find it gives you much in the > way of performance benefits over a large disk file. > I don't know how late the Sarge kernel is, but it is too old to now be used. So the 2.6 kernels should all have the mmap support. I probably will use files instead, but wanted to know all I could before deciding. >> Q2. I suspect the eight partitions restriction mentioned above would >> be for the maximum four primary partitions on each hard drive, on each >> PATA (IDE/EIDE) channel (master and slave, or "device0" and >> "device1")? What about doubling this to 16 if a secondary PATA channel >> is used (two additional hard drives)? >> > > No, it's that you used to only be able to get four primary and four > extended partitions per drive. I think this is fairly obsolete at this > point with extended logical partitions, although I'm not positive. (I > never have any need to create lots of partitions these days, so I > haven't looked.) > Yes, four primary partitions were the limit. AFAIK, it still is a limit on most "PC" BIOS systems when using PATA (IDE/EIDE/ATAPI/...). If/when Unix "takes over," then the rules change. However, you could make one (or more) primary partitions into an "extended partition," which is a "container" for logical partitions. The maximum number of logical partitions is now limited by the size of the drive. "Under most DOS and some Windows operating systems, the number of logical drives in an extended partition was limited to 23, because the FDISK program couldn't create any more drives than it could assign a drive letter to; thus, assuming C: is a primary drive, the DOS drive letters D: through Z: allow for only 23 more drives. Under Windows NT and later, an unlimited number of logical partitions can be created using the Computer Management's, Disk Management Extension; though in practice, users rarely created more than 23, since the Windows NT shell (user interface) was still limited to accessing only those drives with an A: through Z: drive letter. Some newer operating systems may implement an AA: through ZZ: drive lettering scheme; making it possible to access over 670 logical drives." http://en.wikipedia.org/wiki/Extended_partition#fn_4 My question was really asking if that eight partition restriction was because of "old thinking," or if more than eight could now be used, since more than eight is possible with extended partitions and multiple drives. IOW, the hardware has vastly improved, but does the software still have the eight partition restriction. You and I seem to be thinking along the same track: believing it is possible, but not actually have done it, we can't swear on it. Maybe I should be the gofer? ;-) I have two weeks of time (wasted) on one 40 GB hard drive, trying to get Linux installed and running, when the BIOS evidentially has a 32 GB restriction. I tried all kinds of tricks, like /boot in the first small partition, and then swap following that, with / using the remainder of the 32 GB, but it still wouldn't install and run. Luckily the hard drive has a duplicate MS-SL-CS jumper header for a "32GB Clip," so I did get it to work, but lost 8 GB. Before someone calls me a "tightwad" and wonders why I don't upgrade, let me just say these 12 PCs that I wish to use only pull 25 watts, so they are the most economical. If I use a better PC, the wattage will be at least double for the PCs, and additional power for air conditioning. Plus, the clunkers will go to "waste." ;-) -- John No Microsoft, Apple, AT&T, Novell, Trend Micro, nor Ford products were used in the preparation or transmission of this message. The EULA sounds like it was written by a team of lawyers who want to tell me what I can't do. The GPL sounds like it was written by a human being, who wants me to know what I can do.
Re: Mmap and maximum cycbuffs
Author: Alexander Bartolich
Date: Sun, 26 Apr 2009 11:25
Date: Sun, 26 Apr 2009 11:25
124 lines
6004 bytes
6004 bytes
John F. Morse wrote:
> Alexander Bartolich wrote:
> [...]
> Did you click the link I provided to: http://linux.die.net/man/2/mmap ?
Why do you ask that?
I have the man page installed and even told you the package name.
>>> and "apt-cache show mmap" returns, "W: Unable to locate
>>> package mmap E: No packages found" when ran.
>>>
>>
>> $ dpkg -L manpages-dev | wc -l
>> 1661
>>
>> I guess it would exceed the available storage to add the title of
>> every included man page to the description of package "manpages-dev".
>
> Not really.
Why do you say that?
Package manpages-dev contains about 1650 man pages. If the average
title is 8 characters long a listing would take up 12 kiB.
> john@n100:~$ apt-cache show manpages-dev
> [...]
> Description: Manual pages about using GNU/Linux for development
> These man pages describe the Linux programming interface, including
> these two sections:
> 2 = Linux system calls.
> 3 = Library calls (note that a more comprehensive source of information
> may be found in the glibc-doc package).
Obviously this discription does not include the title of every
included man page.
> [...]
>>> Q2. I suspect the eight partitions restriction mentioned above would be
>>> for the maximum four primary partitions on each hard drive,
>>
>> I suspect the number eight refers to the partition scheme used by
>> Sun on its SPARC hardware. Once upon a time there was a similar
>> limit of four on the IBM PC.
>
> There still is the limit. However, "modern" OS software can work around it.
Primary partitions are defined as an array of entries in the master
boot record. This array has four entries.
According to Ralf Brown's Interrupt List partition type 05h ("extended
partition") was introduced with DOS 3.3 in 1986. Logical partitions in
an extended partition are defined as a single linked list. The maximum
number of entries in a single linkes list depends only on the address
space.
>>> on each PATA (IDE/EIDE) channel (master and slave, or "device0"
>>> and "device1")? What about doubling this to 16 if a secondary
>>> PATA channel is used (two additional hard drives)?
>>
>> The number of disks in the system has nothing to do with the
>> number of slices that you can partition one such disk into.
>
> That was not my question.
*scratches head*
I guess you interpret the quoted eight partitions as the total limit
of partitions in the system, across all attached disks.
However, your reasoning makes no sense. If you know that every IDE
channel can drive two disks (master and slave) then you should also
know that since the days of the i386 the standard hardware provides
two IDE channels. So the ancient machine on which Torvalds started
development already was capable of 16 primary partitions.
>>> Q3. Would this restriction of eight partitions still apply if extended
>>> partitions with many logical partitions are used?
>>>
>>
>> You can have an infinite number of logical partitions. However,
>> the device node scheme of the old Linux IDE driver supports only
>> 63 partitions. The SCSI driver, which is nowadays also used for
>> IDE and SATA, supports only 15.
>
> That's 15 drives on EACH SCSI interface card. More cards = more drives. ;-)
>
> Still, you wandered off track from my question about the eight partition
> restriction.
See above.
>>> Q4. What about SCSI and SATA drives and controller interfaces that can
>>> accommodate more than four devices, or added PCI ATA interfaces?
>>>
>>
>> The device node scheme of Linux:
>>
>> $ vdir /dev/sd*
>> brw-rw---- 1 root disk 8, 0 2009-04-08 08:03 /dev/sda
>> brw-rw---- 1 root disk 8, 1 2009-04-08 08:03 /dev/sda1
>> brw-rw---- 1 root disk 8, 2 2009-04-08 08:03 /dev/sda2
>> brw-rw---- 1 root disk 8, 3 2009-04-08 08:03 /dev/sda3
>> brw-rw---- 1 root disk 8, 16 2009-04-08 08:03 /dev/sdb
>> brw-rw---- 1 root disk 8, 17 2009-04-08 08:03 /dev/sdb1
>> brw-rw---- 1 root disk 8, 18 2009-04-08 08:03 /dev/sdb2
>> brw-rw---- 1 root disk 8, 19 2009-04-08 08:03 /dev/sdb3
>> ^ ^^
>> major device number ---+ |
>> |
>> minor device number -------+
>>
>> You can have 256 / 16 = 16 disks.
>> Each disk can have 15 partitions.
>> If you need more, use the logical volume manager (LVM).
>
> Thanks, Alexander, but I wasn't needing a hardware lesson. ;-)
I gave you the exact limit on the number of partitions under Linux.
Yes, this limit is per disk, not a total across all disks.
And a way to circumvent this limit.
What else do you want?
--
seq 100 | sed 's/.*/Romani Ite Domum./'
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads