Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Commits

[master] cc710d5 Explicitly sync the header of the VSM so other processes can read(2) it on kernels without coherent VM/buf (OpenBSD, still ?, really ?)

 

 

Varnish commits RSS feed   Index | Next | Previous | View Threaded


phk at varnish-cache

Aug 9, 2012, 1:23 AM

Post #1 of 1 (58 views)
Permalink
[master] cc710d5 Explicitly sync the header of the VSM so other processes can read(2) it on kernels without coherent VM/buf (OpenBSD, still ?, really ?)

commit cc710d56021a4d1927ceedf426cebfff48ef1860
Author: Poul-Henning Kamp <phk [at] FreeBSD>
Date: Thu Aug 9 08:22:24 2012 +0000

Explicitly sync the header of the VSM so other processes can read(2) it
on kernels without coherent VM/buf (OpenBSD, still ?, really ?)

Submitted by: Federico G. Schwindt

diff --git a/bin/varnishd/mgt/mgt_shmem.c b/bin/varnishd/mgt/mgt_shmem.c
index 79f8c41..bc59194 100644
--- a/bin/varnishd/mgt/mgt_shmem.c
+++ b/bin/varnishd/mgt/mgt_shmem.c
@@ -187,8 +187,7 @@ mgt_shm_size(void)

size = mgt_param.vsl_space + mgt_param.vsm_space;
ps = getpagesize();
- size += ps - 1;
- size &= ~(ps - 1U);
+ size = RUP2(size, ps);
return (size);
}

@@ -247,6 +246,9 @@ mgt_SHM_Create(void)
(void)unlink(fnbuf);
exit (-1);
}
+
+ /* Commit changes, for OS's without coherent VM/buf */
+ AZ(msync(p, getpagesize(), MS_SYNC));
}

/*--------------------------------------------------------------------

_______________________________________________
varnish-commit mailing list
varnish-commit [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit

Varnish commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.