growisofs buffer size does not respect bufsize option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dvd+rw-tools (Debian) |
Fix Released
|
Unknown
|
|||
dvd+rw-tools (Ubuntu) |
Fix Released
|
Medium
|
Martin Pitt |
Bug Description
Binary package hint: dvd+rw-tools
When burning DVDs, growisofs is not honoring the --use-the-
The ring buffer is not of constant size: it varies for each burn, even though k3b informs -use-the-
I checked the code myself and found out that from version 7 growisofs tries limit the buffer size to a maximum of 1/4 of the RAM. In the source _SC_AVPHYS_PAGES returns the number of available, really free memory pages, not the total number of memory pages. Linux tends to use all available memory with buffers and cache, and keep just a bare minimum of free pages during normal use.
So, the code cuts the size of the buffer in half again and again until it is less or equal to 1/4 size of free memory (usually a few MB, 32 or 64 MB at most).
Andy Polyakov (author of growisofs) did not answer my e-mail last year so I patched growisofs myself. Later Fedora applied the same patch I did before.
I simply replaced _SC_AVPHYS_PAGES with _SC_PHYS_PAGES (total number of pages of physical memory in system). I have been using this modified growisofs for a year and no problem arised at all. It might have been a typo only...
--- growisofs.c.bak 2007-01-21 12:56:05.000000000 +0100
+++ growisofs.c 2007-01-21 13:00:02.000000000 +0100
@@ -3096,12 +3096,12 @@
#if defined(__unix) || defined(__unix__)
-#if defined(
- { size_t phys_mem = (size_t)
+#if defined(
+ { size_t phys_mem = (size_t)
if (phys_mem)
- { phys_mem /= 2; /* normally AVPHYS is a bit smaller, so
+ { phys_mem /= 2; /* normally PHYS is a bit smaller, so
while (the_buffer_size > phys_mem) the_buffer_size /= 2;
}
Related branches
Changed in dvd+rw-tools: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in dvd+rw-tools: | |
status: | Unknown → New |
Changed in dvd+rw-tools: | |
assignee: | nobody → pitti |
status: | Confirmed → In Progress |
Changed in dvd+rw-tools: | |
status: | New → Fix Released |
Yes that patch makes sense and it shouldn't have any incompatibility problem. I'll build new packages with this patch and attach here.