Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52bad64d authored by David Howells's avatar David Howells
Browse files

WorkStruct: Separate delayable and non-delayable events.



Separate delayable work items from non-delayable work items be splitting them
into a separate structure (delayed_work), which incorporates a work_struct and
the timer_list removed from work_struct.

The work_struct struct is huge, and this limits it's usefulness.  On a 64-bit
architecture it's nearly 100 bytes in size.  This reduces that by half for the
non-delayable type of event.

Signed-Off-By: default avatarDavid Howells <dhowells@redhat.com>
parent 0f9005a6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ void mce_log_therm_throt_event(unsigned int cpu, __u64 status)

static int check_interval = 5 * 60; /* 5 minutes */
static void mcheck_timer(void *data);
static DECLARE_WORK(mcheck_work, mcheck_timer, NULL);
static DECLARE_DELAYED_WORK(mcheck_work, mcheck_timer, NULL);

static void mcheck_check_cpu(void *info)
{
+4 −7
Original line number Diff line number Diff line
@@ -937,11 +937,8 @@ void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data,
	if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK)
		return;

	PREPARE_WORK(&ap->port_task, fn, data);
	PREPARE_DELAYED_WORK(&ap->port_task, fn, data);

	if (!delay)
		rc = queue_work(ata_wq, &ap->port_task);
	else
	rc = queue_delayed_work(ata_wq, &ap->port_task, delay);

	/* rc == 0 means that another user is using port task */
@@ -5320,8 +5317,8 @@ void ata_port_init(struct ata_port *ap, struct ata_host *host,
	ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN;
#endif

	INIT_WORK(&ap->port_task, NULL, NULL);
	INIT_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap);
	INIT_DELAYED_WORK(&ap->port_task, NULL, NULL);
	INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap);
	INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan, ap);
	INIT_LIST_HEAD(&ap->eh_done_q);
	init_waitqueue_head(&ap->eh_wait_q);
+1 −1
Original line number Diff line number Diff line
@@ -332,7 +332,7 @@ void ata_scsi_error(struct Scsi_Host *host)
	if (ap->pflags & ATA_PFLAG_LOADING)
		ap->pflags &= ~ATA_PFLAG_LOADING;
	else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
		queue_work(ata_aux_wq, &ap->hotplug_task);
		queue_delayed_work(ata_aux_wq, &ap->hotplug_task, 0);

	if (ap->pflags & ATA_PFLAG_RECOVERED)
		ata_port_printk(ap, KERN_INFO, "EH complete\n");
+1 −1
Original line number Diff line number Diff line
@@ -1424,7 +1424,7 @@ static unsigned int ip_cnt;

static void rekey_seq_generator(void *private_);

static DECLARE_WORK(rekey_work, rekey_seq_generator, NULL);
static DECLARE_DELAYED_WORK(rekey_work, rekey_seq_generator, NULL);

/*
 * Lock avoidance:
+1 −1
Original line number Diff line number Diff line
@@ -3580,7 +3580,7 @@ static void initialize_tty_struct(struct tty_struct *tty)
	tty->overrun_time = jiffies;
	tty->buf.head = tty->buf.tail = NULL;
	tty_buffer_init(tty);
	INIT_WORK(&tty->buf.work, flush_to_ldisc, tty);
	INIT_DELAYED_WORK(&tty->buf.work, flush_to_ldisc, tty);
	init_MUTEX(&tty->buf.pty_sem);
	mutex_init(&tty->termios_mutex);
	init_waitqueue_head(&tty->write_wait);
Loading