Displaying 17 results from an estimated 17 matches for "sleep_time".
2008 Mar 18
1
Polling is REALLY slow
...irst
thought was to create a worker that polled for records with the correct
state, but it doesn''t work as expected. Here is what I have with error
checking, etc. removed:
class RequestQueuePollerWorker < BackgrounDRb::MetaWorker
set_worker_name :request_queue_poller_worker
QUEUE_SLEEP_TIME = 30 # seconds
def create(args = nil)
@running = true
self.poll_queue
end
def build_all_matches(args = nil)
thread_pool.defer(args) do |args|
requests = Request.find_active(:all)
requests.each { |request| request.queue! } # using
acts_as_state_machine
end...
2011 Dec 06
0
script for check drbd at mount ocfs2 at boot in debian
...lt-Stop: ? ? ?0 6
# Short-Description: Check the syn of filesystem drbd before mount
ocfs2 filesystems.
# Description: Check the syn of filesystem drbd before mount ocfs2 filesystems.
### END INIT INFO
# Version 1.0
IP_SYNC=192.168.2.1
# Resource number
RES=0
NET_INTERFACE=eth3
SLEEP=10
TIMEOUT=30
SLEEP_TIME=0
MOUNTPOINT="/datos/datosadantra"
#LOG="/bin/echo"
LOG="/usr/bin/logger"
if [ ! -f /proc/drbd ]; then
? ?$LOG "No esta arrancado DRBD..."
? ?exit 1
fi
case "$1" in
?start)
? ? ? ?# Inciando las comprobaciones
ESTADO_MIRROR=`/sbin/drbdadm dstate r...
2014 May 14
0
[RFC PATCH v1 07/16] drm/nouveau: rework to new fence interface
...oid *data, int index)
+static long
+nouveau_fence_wait_legacy(struct fence *f, bool intr, long wait)
{
- struct nouveau_fence_priv *priv = data;
- wake_up_all(&priv->waiting);
- return NVKM_EVENT_KEEP;
-}
+ struct nouveau_fence *fence = container_of(f, typeof(*fence), base);
+ unsigned long sleep_time = NSEC_PER_MSEC / 1000;
+ unsigned long t = jiffies, timeout = t + wait;
-static int
-nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr)
+ while (!nouveau_fence_done(fence)) {
+ ktime_t kt;
-{
- struct nouveau_channel *chan = fence->channel;
- struct nouveau_fifo *pfifo = nou...
2007 Dec 06
1
Fetcher Daemon Questions - receive???
...with Slantwise.com''s Fetcher to process emails via
a Ruby script.
Here''s the basic code lifted from their plugin:
[code]
class MailFetcherDaemon < Daemon::Base
@config = YAML.load_file("#{RAILS_ROOT}/config/mail.yml")
@config = @config[RAILS_ENV].to_options
@sleep_time = @config.delete(:sleep_time) || 10
def self.start
puts "Starting MailFetcherDaemon"
# Add your own receiver object below
@fetcher = Fetcher.create({:receiver => nil}.merge(@config))
loop do
puts "checking mail"
@fetcher.fetch
sleep(@slee...
2008 Jan 17
3
periodic scheduling
...cheduling
options to quite do what I wanted to do, so I just ran without
scheduling. I manually started all my workers by calling
MiddleMan.new_worker in a script, passing in the "sleep time", and
then implemented each worker something like this:
def do_work(args)
@args = args
@sleep_time = @args[:sleep_time]
logger.info "CampaignStarter #{jobkey} started"
while(true)
# do the actual work in another method
main_work
sleep @sleep_time
end
end
That seemed to work pretty well for the most part.
So now, looking at the current version. I'&...
2007 May 22
4
Recommendations for eternally-running backgroundrb workers?
I''ve got some workers that I want to have running all the time. Right
now I''m just launching them manually, by requesting a special page in
my rails app that includes lines like:
MiddleMan.new_worker(:class=> :receiver, :job_key=>:r,
:args=>{:sleep_time=>10})
This strikes me as a really weak way to fire up my workers. I
basically want to automate things so that these will be started by a
script in /etc/rc?.d. It seems like using the backgroundrb scheduler
is not a possibility, since do_work never returns from my workers
(each of them runs in...
2002 Jul 13
0
[PATCH]: scp program improved
...eval wait, lastupdate, now;
static BUF buffer;
BUF *bp;
- off_t i, amt, result;
+ off_t i, amt, result, bcounter;
int fd, haderr, indx;
- char *last, *name, buf[2048];
+ char *last, *name, buf[2048], c;
int len;
+ /* For rate limit */
+ int buf_size, cur_mod;
+ long int sleep_time;
- for (indx = 0; indx < argc; ++indx) {
+ for (indx = 0; indx < argc; ++indx) {
name = argv[indx];
statbytes = 0;
len = strlen(name);
@@ -536,14 +581,19 @@
if (response() < 0)
goto next;
}
+ if (resume_mode)
+ c = 'R';
+ else...
2012 Apr 22
1
[PATCH 2/5] drm/nouveau: base fence timeout on time of emission
...void *sync_obj, void *sync_arg)
int
__nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
{
- unsigned long timeout = jiffies + (3 * DRM_HZ);
+ struct nouveau_fence *fence = nouveau_fence(sync_obj);
+ unsigned long timeout = fence->emitted_at + 3 * DRM_HZ;
unsigned long sleep_time = NSEC_PER_MSEC / 1000;
ktime_t t;
int ret = 0;
--
1.7.8.5
2019 May 26
2
Low Battery False Alarms
2019 May 25
2
Low Battery False Alarms
2013 May 20
1
[PATCH] xfstests: btrfs 308: regression test for btrfs send
I''m not sure how the numbering is supposed to work now that we''ve split
everything out so I''m just going with the next number in the directory. This is
a regression test for btrfs send, we had a problem where we''d try to send a file
that had been deleted in the source snapshot. This is just to make sure we
don''t have the same problem in the future.
2014 May 14
17
[RFC PATCH v1 00/16] Convert all ttm drivers to use the new reservation interface
This series depends on the previously posted reservation api patches.
2 of them are not yet in for-next-fences branch of
git://git.linaro.org/people/sumit.semwal/linux-3.x.git
The missing patches are still in my vmwgfx_wip branch at
git://people.freedesktop.org/~mlankhorst/linux
All ttm drivers are converted to the fence api, fence_lock is removed
and rcu is used in its place.
qxl is the first
2014 Jul 31
19
[PATCH 01/19] fence: add debugging lines to fence_is_signaled for the callback
fence_is_signaled callback should support being run in
atomic context, but not in irq context.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
---
include/linux/fence.h | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/include/linux/fence.h b/include/linux/fence.h
index d174585b874b..c1a4519ba2f5 100644
---
2014 Jul 09
22
[PATCH 00/17] Convert TTM to the new fence interface.
This series applies on top of the driver-core-next branch of
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
Before converting ttm to the new fence interface I had to fix some
drivers to require a reservation before poking with fence_obj.
After flipping the switch RCU becomes available instead, and
the extra reservations can be dropped again. :-)
I've done at least basic
2012 Apr 25
5
[PATCH v2 4/4] drm/nouveau: gpu lockup recovery
...ouveau/nouveau_fence.c
@@ -233,17 +233,22 @@ int
__nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
{
struct nouveau_fence *fence = nouveau_fence(sync_obj);
+ struct drm_device *dev = fence->channel->dev;
unsigned long timeout = fence->timeout;
unsigned long sleep_time = NSEC_PER_MSEC / 1000;
ktime_t t;
int ret = 0;
+ if (nouveau_gpu_reset_in_progress(dev))
+ timeout = jiffies + DRM_HZ / 5;
+
while (1) {
if (__nouveau_fence_signalled(sync_obj, sync_arg))
break;
if (time_after_eq(jiffies, timeout)) {
- ret = -EBUSY;
+ if (!nouveau_gpu_rese...
2007 Mar 13
5
worker starting twice
...:45:22 (5595) MbSender ms2 started
20070313-15:45:22 (5595) Receiver r started
20070313-15:45:30 (5595) MbReceiver mr started.
The relevant chunk of backgroundrb_schedules.yml looks like this:
mb_receiver:
:class: :mb_receiver
:job_key: :mr
:worker_method: :do_work
:args:
:sleep_time: 5
:trigger_args: 0,10,20,30,40,50 * * * * * *
The other workers have identical trigger_args, but don''t exhibit this behavior.
The do_work method just calls another method that loops forever, and I
wrapped that call in an exception handler to see if it was crapping
out or something,...
2012 Apr 22
2
[RFC PATCH 5/5] drm/nouveau: gpu lockup recovery
...ence.c
@@ -233,17 +233,22 @@ int
__nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
{
struct nouveau_fence *fence = nouveau_fence(sync_obj);
+ struct drm_device *dev = fence->channel->dev;
unsigned long timeout = fence->emitted_at + 3 * DRM_HZ;
unsigned long sleep_time = NSEC_PER_MSEC / 1000;
ktime_t t;
int ret = 0;
+ if (nouveau_gpu_reset_in_progress(dev))
+ timeout = fence->emitted_at + DRM_HZ / 5;
+
while (1) {
if (__nouveau_fence_signalled(sync_obj, sync_arg))
break;
if (time_after_eq(jiffies, timeout)) {
- ret = -EBUSY;
+ if (!nou...