Date: Sun, 06 Jan 2008 21:13:22 -0800 From: Xin LI <delphij@delphij.net> To: freebsd-arch@FreeBSD.org Cc: dfr@FreeBSD.org, mengguang@staff.sina.com.cn Subject: Why it does not make sense if msginfo.msgssz is greater than 256? Message-ID: <4781B4F2.9040707@delphij.net>
next in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, While pursuing sys/kern/sysv_msg.c, we found the following comment: * Each message is broken up and stored in segments that are msgssz bytes * long. For efficiency reasons, this should be a power of two. Also, * it doesn't make sense if it is less than 8 or greater than about 256. * Consequently, msginit in kern/sysv_msg.c checks that msgssz is a power of * two between 8 and 1024 inclusive (and panic's if it isn't). And it seems to be come from the following comment: /* * msginfo.msgssz should be a power of two for efficiency reasons. * It is also pretty silly if msginfo.msgssz is less than 8 * or greater than about 256 so ... */ Why is there the limitation (recommendation)? Thanks in advance! Cheers, - -- Xin LI <delphij@delphij.net> http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHgbTyi+vbBBjt66ARAuJmAKCAw8qZuYtVMIxjY1BXkNad57BVTACgt6zF 3l5/4Bd55EoNy8aFhm+RXyc= =qWJk -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4781B4F2.9040707>