-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use shared memory objects for data #429
Commits on Aug 1, 2018
-
Store forward destination IP address and host name in contiguous stri…
…ng buffer Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 3e88490 - Browse repository at this point
Copy the full SHA 3e88490View commit details -
Use strbuffer also for client IPs and host names
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for b7da12b - Browse repository at this point
Copy the full SHA b7da12bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96928c7 - Browse repository at this point
Copy the full SHA 96928c7View commit details
Commits on Aug 2, 2018
-
Rename last_pos to next_pos and use struct for string buffer
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 1a508fc - Browse repository at this point
Copy the full SHA 1a508fcView commit details -
Store size in string buffer + use long long for string position indices
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for d7d8518 - Browse repository at this point
Copy the full SHA d7d8518View commit details -
Add shared memory components to store strings in shared memory
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 1b7e084 - Browse repository at this point
Copy the full SHA 1b7e084View commit details -
Configuration menu - View commit details
-
Copy full SHA for bb51f4e - Browse repository at this point
Copy the full SHA bb51f4eView commit details -
Allocate shared memory in units of pages
Signed-off-by: DL6ER <dl6er@dl6er.de>
1Configuration menu - View commit details
-
Copy full SHA for 2e12558 - Browse repository at this point
Copy the full SHA 2e12558View commit details -
Unify two if statements into one + allocate already one page size ini…
…tially Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for f1ba139 - Browse repository at this point
Copy the full SHA f1ba139View commit details -
Also store domains struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 0ced77c - Browse repository at this point
Copy the full SHA 0ced77cView commit details -
Also store clients struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 249d236 - Browse repository at this point
Copy the full SHA 249d236View commit details -
Also store forwarded struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
2Configuration menu - View commit details
-
Copy full SHA for 584c23d - Browse repository at this point
Copy the full SHA 584c23dView commit details -
Also store queries struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 5d22aa7 - Browse repository at this point
Copy the full SHA 5d22aa7View commit details
Commits on Aug 3, 2018
-
Configuration menu - View commit details
-
Copy full SHA for edf7461 - Browse repository at this point
Copy the full SHA edf7461View commit details -
Fix wrong error message, remove duplicated resized message, and don't…
… assume char* pointer type (use void* and cast at the right places if needed) Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 74d25d1 - Browse repository at this point
Copy the full SHA 74d25d1View commit details -
Use munmap + mmap instead of mremap when enlarging shared memory objects
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 0003a41 - Browse repository at this point
Copy the full SHA 0003a41View commit details -
Move query type determination further up
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 77f932b - Browse repository at this point
Copy the full SHA 77f932bView commit details -
First munmap() the shared memory object, thereafter resize it (using …
…ftruncate), and only then mmap() it again Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for f40d8b1 - Browse repository at this point
Copy the full SHA f40d8b1View commit details -
man shm_open recommends to use shared memory object names starting wi…
…th "/" for portability Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for f72a4cd - Browse repository at this point
Copy the full SHA f72a4cdView commit details -
Re-open shared memory object when resizing the object using ftruncate…
…(). shm_open() automatically sets FD_CLOEXEC which closes the file handler automatically whenever something is calling system() to avoid leaking the file descriptors to random programs. The file descriptor becomes invalid and later mmap operations fail. We always use shm_open() (without the O_CREAT attribute) every time before we run mmap to ensure we always have a valid file descriptor. Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 9f275a0 - Browse repository at this point
Copy the full SHA 9f275a0View commit details
Commits on Aug 4, 2018
-
Allocate more struct memory earlier
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for eb1d851 - Browse repository at this point
Copy the full SHA eb1d851View commit details
Commits on Sep 2, 2018
-
Merge branch 'development' into new/shmem
# Conflicts: # api.c # dnsmasq_interface.c
Configuration menu - View commit details
-
Copy full SHA for bbfe186 - Browse repository at this point
Copy the full SHA bbfe186View commit details -
Fix compile error due to merge
The merged in code tried to use normal strings instead of shared memory strings. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for 992726d - Browse repository at this point
Copy the full SHA 992726dView commit details -
unsigned int is smaller than long long, which all of the string position data was using. This generated a lot of warnings. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for 99c4e40 - Browse repository at this point
Copy the full SHA 99c4e40View commit details -
Use unsigned long long for string positions
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for 3585043 - Browse repository at this point
Copy the full SHA 3585043View commit details -
Only use a single NULL terminator in strings shared memory
Previously two NULL bytes were used between strings, which was not intended. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for d96c009 - Browse repository at this point
Copy the full SHA d96c009View commit details -
Fix shared memory resize not being remembered
The new size was not remembered after resizing, causing it to never resize larger than two 4k blocks of items. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for e91369f - Browse repository at this point
Copy the full SHA e91369fView commit details -
Add stdbool include to shmem.h
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for 8401c9b - Browse repository at this point
Copy the full SHA 8401c9bView commit details
Commits on Sep 3, 2018
-
Move counters to shared memory
This requires that it be accessed through a pointer, so most of the changes are just changing `counters.` to `counters->` Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for ae1bb5b - Browse repository at this point
Copy the full SHA ae1bb5bView commit details
Commits on Sep 17, 2018
-
Merge remote-tracking branch 'origin/development' into new/shmem
# Conflicts: # dnsmasq_interface.c # resolve.c
Configuration menu - View commit details
-
Copy full SHA for 3d439ad - Browse repository at this point
Copy the full SHA 3d439adView commit details
Commits on Sep 18, 2018
-
Use negative query IDs for queries loaded from the database
This is necessary for all queries to have unique IDs. Previously, all queries loaded from the database had an ID of zero. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for e1c8ccc - Browse repository at this point
Copy the full SHA e1c8cccView commit details
Commits on Sep 19, 2018
-
Merge pull request #382 from pi-hole/feature/negative-database-query-ids
Use negative query IDs for queries loaded from the database
Configuration menu - View commit details
-
Copy full SHA for 9e4d77a - Browse repository at this point
Copy the full SHA 9e4d77aView commit details -
Put overTime data into shared memory
The array of overTime structs is separate from the client data, because the client data is dynamically sized. Each client has a separate shared memory block named `/FTL-client-ID` where `ID` is the numerical ID of the client. The client data is an array of ints, which is indexed using the overTime time indexes. Before, the code referenced the client data via `overTime[timeIndex].clientdata[clientID]` Now, the code references the data via `overTimeClientData[clientID][timeIndex]` The client data is updated whenever a new client or overTime slot is added, so referencing the client data should always be valid. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for cd41aae - Browse repository at this point
Copy the full SHA cd41aaeView commit details
Commits on Sep 21, 2018
-
Merge pull request #385 from pi-hole/feature/shmem-overTime
Put overTime data into shared memory
Configuration menu - View commit details
-
Copy full SHA for 45832da - Browse repository at this point
Copy the full SHA 45832daView commit details
Commits on Sep 25, 2018
-
Fix error freeing client shared memory
The client name was freed before the shared memory was freed, so it was used after free in delete_shm. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for b936e2b - Browse repository at this point
Copy the full SHA b936e2bView commit details -
Fix interchanged indizes in GC routine
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 325fc64 - Browse repository at this point
Copy the full SHA 325fc64View commit details
Commits on Sep 26, 2018
-
Configuration menu - View commit details
-
Copy full SHA for ea7cdfb - Browse repository at this point
Copy the full SHA ea7cdfbView commit details -
Allocate individual client overTime objects guaranteed pagesize-aligned
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 776f91c - Browse repository at this point
Copy the full SHA 776f91cView commit details
Commits on Oct 5, 2018
-
This replaces the previous mutex managed by threads.c. The lock is stored in shared memory with the name "/FTL-lock", and any clients connecting to the shared memory are expected to use the lock when accessing memory. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for 8c68aac - Browse repository at this point
Copy the full SHA 8c68aacView commit details -
Remove threads.o from Makefile
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for 3283d68 - Browse repository at this point
Copy the full SHA 3283d68View commit details -
Fix lock initializers for arm build
The arm compiler does not like the `{ 0 }` initializers for some reason. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for fa9e7b1 - Browse repository at this point
Copy the full SHA fa9e7b1View commit details
Commits on Oct 7, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 215fa14 - Browse repository at this point
Copy the full SHA 215fa14View commit details -
Merge pull request #389 from pi-hole/new/shmem-clients-pagesize
Allocate individual client overTime objects guaranteed pagesize-aligned
Configuration menu - View commit details
-
Copy full SHA for c3934eb - Browse repository at this point
Copy the full SHA c3934ebView commit details -
Store database ID in queries struct. This information will be availab…
…e through shmem to the API to support transparent overlap with the SQlite3 database Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 1279b93 - Browse repository at this point
Copy the full SHA 1279b93View commit details
Commits on Oct 11, 2018
-
Obtain ID before insertion transaction and store IDs only when a quer…
…y has actually been saved instead of trying to do this in a post-processing step Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 601722d - Browse repository at this point
Copy the full SHA 601722dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca2e38b - Browse repository at this point
Copy the full SHA ca2e38bView commit details -
Remove read lock and simplify lock names
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for d7b4ce8 - Browse repository at this point
Copy the full SHA d7b4ce8View commit details -
Change shm lock to a robust mutex
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for a3e9677 - Browse repository at this point
Copy the full SHA a3e9677View commit details
Commits on Oct 13, 2018
-
Use a condition variable and boolean to notify FTL is waiting for a lock
This is checked by accessors of shared memory to defer to FTL so they do not starve FTL of access to shared memory (starving DNS resolution). Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for b0c8a54 - Browse repository at this point
Copy the full SHA b0c8a54View commit details
Commits on Oct 24, 2018
-
Remove condition variable from shared memory lock
It is no longer needed. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for ece89a5 - Browse repository at this point
Copy the full SHA ece89a5View commit details
Commits on Oct 25, 2018
-
Set queryID to zero for queries imported from the database on startup
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 100d92b - Browse repository at this point
Copy the full SHA 100d92bView commit details -
Configuration menu - View commit details
-
Copy full SHA for f8ba173 - Browse repository at this point
Copy the full SHA f8ba173View commit details -
Merge pull request #398 from pi-hole/new/shmem_databaseID
Store database ID in queries struct
Configuration menu - View commit details
-
Copy full SHA for f0dabf6 - Browse repository at this point
Copy the full SHA f0dabf6View commit details
Commits on Nov 21, 2018
-
Merge branch 'development' into new/shmem
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for 85290bb - Browse repository at this point
Copy the full SHA 85290bbView commit details -
Merge branch 'new/shmem' into feature/shm-lock
# Conflicts: # database.c # request.c
Configuration menu - View commit details
-
Copy full SHA for ff4d985 - Browse repository at this point
Copy the full SHA ff4d985View commit details -
Fix reference to old lock functions
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for befc0f8 - Browse repository at this point
Copy the full SHA befc0f8View commit details
Commits on Dec 9, 2018
-
Merge pull request #396 from pi-hole/feature/shm-lock
Add shared memory lock
Configuration menu - View commit details
-
Copy full SHA for 0760461 - Browse repository at this point
Copy the full SHA 0760461View commit details -
Merge branch 'development' into new/shmem
Signed-off-by: DL6ER <dl6er@dl6er.de>
Configuration menu - View commit details
-
Copy full SHA for a595f21 - Browse repository at this point
Copy the full SHA a595f21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 120aeb4 - Browse repository at this point
Copy the full SHA 120aeb4View commit details