summaryrefslogtreecommitdiffstats
path: root/xlators/performance
Commit message (Collapse)AuthorAgeFilesLines
* fix build warnings in 'io-cache'Amar Tumballi2009-07-201-1/+7
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 130 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130
* quick-read: implement release and forget cbks.Raghavendra G2009-07-161-0/+49
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_lk.Raghavendra G2009-07-161-0/+97
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_ftruncate.Raghavendra G2009-07-161-0/+142
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_fsync.Raghavendra G2009-07-161-0/+94
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_finodelk.Raghavendra G2009-07-161-0/+100
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_fentrylk.Raghavendra G2009-07-161-0/+100
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_flush.Raghavendra G2009-07-161-0/+74
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_fgetxattr.Raghavendra G2009-07-161-0/+101
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_fsetxattr.Raghavendra G2009-07-161-0/+99
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement lc_fchmodRaghavendra G2009-07-161-0/+93
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_fchownRaghavendra G2009-07-161-0/+95
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_fstat.Raghavendra G2009-07-161-0/+94
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_writevRaghavendra G2009-07-161-0/+118
| | | | | | - writev on any fd opened on a file invalidates the cache stored during lookup Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_readvRaghavendra G2009-07-161-0/+525
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - pseudo-code of the algorithm is given below if (content is cached) { validate-contents (); if (content cached is valid) { stack unwind with cached content; } else { goto read-from-storage; } } else { goto read-from-storage; } return; read-from-storage: if (open is already done on fd) { stack-wind read; } else { add the current readv to list of operations waiting on completion of open; if (open on the fd is in transit) { do nothing; } else { stack-wind open; } } return; Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: implement qr_openRaghavendra G2009-07-162-0/+219
| | | | | | | | - The file is opened actually only if it is not cached already in lookup. This adds responsibility for fops operating on fds to make sure that a valid fd actually opened on a file is used to complete the fop. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* quick-read: add qr_lookup.Raghavendra G2009-07-162-0/+147
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Implementing quick-read translator.Raghavendra G2009-07-165-1/+184
| | | | | | | | | | | | | | | | | lookup can fetch the entire file in xattr dictionary using the key "glusterfs.content". We set the maximum size of the file that can be fetched so in the xattr_req dictionary using the same key. If file-size is less than or equal to the value set in dictionary, the content is stored in the dictionary using same key in lookup_cbk. For small files, we can do an optimization wherein we do not really send the calls open, read and close to the storage translators. Instead there can be an xlator which fakes open, read and close calls. For reads, it sends the data it has cached during lookup and hence saving the time for open, read and close calls to reach storage translators (this time can be significant if calls have to go through network to reach storage translator). Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* write-behind: set default window-size to 1MB.Raghavendra G2009-07-071-1/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* read-ahead: use O_ACCMODE for checking file access modes.Raghavendra G2009-07-071-2/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* write-behind: Use O_ACCMODE while checking for access modes.Raghavendra G2009-07-071-2/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* performance/write-behind - bug fix in open() and create().Basavanagowda Kanur2009-07-021-1/+5
| | | | | | | | open() & create() calls should reset frame->local to NULL. bz# 104 Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* enhancement in write-behindAmar Tumballi2009-06-301-18/+22
| | | | | | | | | Write calls should not be pushed to background only when the mandatory locking is enabled, in all other cases (eg: O_SYNC, O_DIRECT etc), we should not be 'caching' any data, but the calls can be pushed to the background. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* write-behind: fix memory corruptionRaghavendra G2009-06-151-0/+1
| | | | | | | | - wb_sync did not set local = NULL after stack_wind. It also used to free local if its not NULL as part of cleanup process. Hence there was a double free in STACK_DESTROY done in wb_sync_cbk. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* write-behind: check for memory allocation failures and take appropriate actionRaghavendra G2009-06-151-78/+434
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-cache: fix warning by initializing conf = NULLAnand V. Avati2009-06-151-1/+1
|
* read-ahead: fix warning by initializing conf = NULLAnand V. Avati2009-06-151-1/+1
|
* io-cache: handle memory allocation failuresRaghavendra G2009-06-114-65/+373
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Fix missed notification in sem_timedwaitShehjar Tikoo2009-06-112-5/+4
| | | | | | | | | | | | | | | We're performing a calculation for skewing idle time that resulted in a timespec.tv_nsec value becoming larger than 1000 million or less than 0, forcing sem_timedwait to return with an EINVAL instead of waiting for a request notification from sem_post in iot_notify_worker(). This resulted in a missed notification that resulted in a hang followed by a timeout on the protocol/client side. This commit avoids the over- and under-flow in tv_nsec by skewing the tv_sec value instead. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* read-ahead: handle memory allocation failuresRaghavendra G2009-06-113-17/+111
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* read-ahead: return with error code EBADF for fops on fds without file set in ↵Raghavendra G2009-06-111-11/+45
| | | | | | | | | | | their context. - since a successful open/create will _always_ set a pointer to ra_file_t in context of fd, this fix makes sense. - an example of operations on bad fd can be afr sending read on the child which was down during open. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* read-ahead: unwind with a return value of -1 and error code of ENOMEM on ↵Raghavendra G2009-06-111-0/+4
| | | | | | memory allocation for ra_file in open/create Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* removed unused option 'page-size' in io-cacheAmar Tumballi2009-06-091-5/+0
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-cache: prevent frames from getting woken up while page is getting validatedAnand Avati2009-06-031-1/+1
| | | | | | | | | | | | | | | | 1. A page will be put on the inode waitq if the 'freshness' has to be verified with an fstat() 2. while the fstat is in transit, other calls (like lookup) can update ioc_inode->tv, resetting the freshness (page still on inode waitq) 3. Another read request on the same page, after the updated freshness, will wake up the page frames neglecting the fact that the page is also waiting on the inode (waiting for the fstat completion) 4. once the page's frames are woken, the page becomes elegible for purging and can get destroyed for various reasons, leaving a destroyed page pointer in the inode's waitq 5. fstat returns and hits the destroyed page pointer causing a crash The fix is to all together disable cache hits when any page of the same inode is under validation. The otherwise cache hit will now be subjected to the ongoing validation by getting queued to the inode waitq. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* mem-pool,io-threads: Destroy mem-pool on deallocationShehjar Tikoo2009-05-211-0/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Use boolean enums instead of integer 1Shehjar Tikoo2009-05-201-2/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Change mutexes/condvars to spinlocks/semaphoresShehjar Tikoo2009-05-202-36/+80
| | | | | | | | | | | | | | | | | It seems that use of mutexes is resulting in pretty high thread sleep and wake-up cost. What is worse, if a worker thread has acquired a lock, there is a possibility of the main glusterfs thread being put to sleep. We change the use of mutexes into spinlock. At the same time, we cannot anymore use condvars for notification since the condvar interface depends on mutexes itself. Semaphores come to out rescue. Luckily, even the pthread semaphores have a timedwait interface to allow our idle worker threads to make an exit decision. Further, it is possible that spinlocks are not available on all systems so all this is curtained behind #defines so we can fall back to mutexes and condvars implementation. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Reduce default max for threads to 64Shehjar Tikoo2009-05-201-1/+1
| | | | | | | | | We've had complaints from users who've used autoscaling option with default settings for min and max threads, about high memory consumption because of the large default value for max-threads. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Support mem-pool allocator for iot_request_tShehjar Tikoo2009-05-202-23/+44
| | | | | | | | | | | | | | | | This commit brings in support for allocation of iot_request_t's in io-threads through the use of the mem-pool. We're hoping that the overheads of hundreds and thousands of small allocations can be avoided through this. The important point to note is that the memory pool is not for the translator as a whole but there is one small memory pool for each worker thread. Not only does that help us avoid malloc overheads for small allocations like iot_request_t but also avoid contention on the heap data structures when multiple threads want an iot_request_t from the pool. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Add graceful shutdown of worker threadsRaghavendra G2009-05-202-25/+79
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: handle memory allocation failuresRaghavendra G2009-05-201-197/+760
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* symlink-cache: fix return value of readlinkRaghavendra G2009-05-071-2/+2
| | | | | | | | | - sc_readlink wrongly returned strlen (link) + 1 when link was present in cache. - this fixes rt #828. Since fuse_readlink_cbk does link[op_ret] = '\0', there was a memory corruption. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* log level fixes in read-aheadAnand V. Avati2009-05-051-6/+6
|
* io-cache logging level fixesAnand V. Avati2009-05-054-33/+32
|
* io-threads: Clarify thread count rangeShehjar Tikoo2009-05-052-16/+23
| | | | | | | | | | | | | | | This patch cleans up io-threads behaviour regarding the range values that can be specified for min-threads and max-threads. THe major change is that the min threads have been reduced to 2 to signify that io-threads needs minimum two threads for its operation, while keeping the default number of threads at 16. The idea is to decouple the default thread count from the minimum thread count. Note to Avati: This applies over Raghu's indentation and logging take-3 patch. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* io-cache: indentation and logging fixesRaghavendra G2009-05-054-509/+426
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* io-threads: indentation and logging fixesRaghavendra G2009-05-052-199/+250
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* write-behind: indentation and logging fixesRaghavendra G2009-04-301-158/+74
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* read-ahead: indentation and logging fixesRaghavendra G2009-04-302-105/+84
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* io-threads: Add fxattrop fopShehjar Tikoo2009-04-221-666/+565
| | | | | | -- added some indentation fixes Signed-off-by: Anand V. Avati <avati@amp.gluster.com>