Opened 17 years ago

Closed 13 years ago

#3421 closed enhancement (Fixed)

Enhancement: use of sys_ioprio_set for jobqueue

Reported by: anonymous Owned by: cpinkham
Priority: minor Milestone: 0.25
Component: MythTV - Mythjobqueue Version: head
Severity: low Keywords: jobqueue
Cc: Ticket locked: no

Description

I've attached a patch that allows settings of I/O priorities via sys_ioprio_set for jobqueue jobs. I find this useful for my master back-end which I like to have set to process two job-queue jobs simultaneously - at the same time I want to ensure that this does not get in the way of recording (my master back-end has 4 inputs (3 local and 1 remote) plus 2 outputs (1 local and 1 remote)).

The patch is not really production ready and I don't know if anyone else will really be interested in it, however I thought I'd better submit it so people at least have a chance to reject it ;-)

BTW, this patch also fixes a bug I noticed in the setting of normal priorities - previously the priority was set before the job process was spawned and (I assume) reset back to its previous value after the job was spawned. Unfortunately there appeared to be some race condition with this somewhere, as sometimes the spawned jobs were not nice'd as expected. Moving the setpriority() call to after the fork() but before the exec() fixed this problem. If the rest of the patch gets rejected I can submit this as a separate patch...

Attachments (2)

mythtv_jobqueue_ionice.diff (6.5 KB) - added by rd.mora@… 17 years ago.
Patch to set I/O nice level to idle on jobqueue processes (not production ready)
mythtv_jobqueue_ionice.zip (2.5 KB) - added by rd.mora@… 17 years ago.
Updated version of previous patch

Download all attachments as: .zip

Change History (12)

Changed 17 years ago by rd.mora@…

Attachment: mythtv_jobqueue_ionice.diff added

Patch to set I/O nice level to idle on jobqueue processes (not production ready)

comment:1 Changed 17 years ago by rd.mora@…

The trac diff viewer doesn't seem to like my patch (though if you download instead it is fine) - any advice I where I went wrong? I just captured the output of "svn diff"....

comment:2 Changed 17 years ago by cpinkham

Owner: changed from Isaac Richards to cpinkham

I'm unable to open this diff, can you try reattaching or reattaching after gzipping please?

comment:3 Changed 17 years ago by rd.mora@…

Sure - see attachment. I've also updated this to the latest SVN HEAD and added a configure option as well. Some notes that I missed before:

  • see /usr/src/linux/Documentation/block/ioprio.txt for details on io-priorities
  • Requires that your kernel is compiled with CONFIG_IOSCHED_CFQ=y and CONFIG_DEFAULT_IOSCHED="cfq"
  • Requires CAP_SYS_ADMIN privilege (at least to use idle or RT priorities)

Changed 17 years ago by rd.mora@…

Attachment: mythtv_jobqueue_ionice.zip added

Updated version of previous patch

comment:4 Changed 16 years ago by cpinkham

Milestone: unknown0.22

comment:5 Changed 15 years ago by Dibblah

Status: newassigned

comment:6 Changed 15 years ago by cpinkham

Milestone: 0.220.23

comment:7 Changed 15 years ago by stuartm

Component: mythtvMythTV - Mythjobqueue

comment:8 Changed 14 years ago by cpinkham

Milestone: 0.230.24

Moving some things to 0.24 since we're almost at the 0.23 feature freeze.

comment:9 Changed 14 years ago by cpinkham

Milestone: 0.24unknown

comment:10 Changed 13 years ago by cpinkham

Milestone: unknown0.25
Resolution: Fixed
Status: assignedclosed

Closing this ticket since Daniel added a way to set the I/O priority for commercial flagging and transcoding in [27257].

Note: See TracTickets for help on using tickets.