linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Rico Tudor <rico@patrec.com>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	<linux-kernel@vger.kernel.org>
Subject: [patch] highmem-2.4.2-A0
Date: Mon, 26 Feb 2001 21:44:16 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.30.0102262139420.7414-200000@elte.hu> (raw)
In-Reply-To: <20010226181049.G29254@athlon.random>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 693 bytes --]


On Mon, 26 Feb 2001, Andrea Arcangeli wrote:

> The highmem changes in 2.4.2ac3 has a couple of bugs, one relevant
> that can generate deadlocks (re-enable interrupts with io_request_lock
> acquired).

oops, right, the emergency-pool patch was just a quick hack to check
whether this is the final problem affecting RL highmem systems.

the attached highmem-2.4.2-A0 patch does the jist of your fixes, against
-ac4. Differences: no need to complicate highmem.c with pool-fillup on
bootup. It will get refilled after the first disk-accesses anyway.

i'm unsure about the other changes done by your patch, could you explain
them? Notably the pgalloc-3level.h and fault.c changes. Thanks,

	Ingo

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1705 bytes --]

--- linux/mm/highmem.c.orig	Mon Feb 26 23:33:17 2001
+++ linux/mm/highmem.c	Mon Feb 26 23:37:02 2001
@@ -217,6 +217,7 @@
 static inline void bounce_end_io (struct buffer_head *bh, int uptodate)
 {
 	struct page *page;
+	unsigned long flags;
 	struct list_head *tmp;
 	struct buffer_head *bh_orig = (struct buffer_head *)(bh->b_private);
 
@@ -231,27 +232,27 @@
 		__free_page(page);
 	else {
 		tmp = &emergency_pages;
-		spin_lock_irq(&emergency_lock);
+		spin_lock_irqsave(&emergency_lock, flags);
 		/*
 		 * We are abusing page->list to manage
 		 * the highmem emergency pool:
 		 */
 		list_add(&page->list, &emergency_pages);
 		nr_emergency_pages++;
-		spin_unlock_irq(&emergency_lock);
+		spin_unlock_irqrestore(&emergency_lock, flags);
 	}
 	
 	if (nr_emergency_pages >= POOL_SIZE)
 		kmem_cache_free(bh_cachep, bh);
 	else {
 		tmp = &emergency_bhs;
-		spin_lock_irq(&emergency_lock);
+		spin_lock_irqsave(&emergency_lock, flags);
 		/*
 		 * Ditto in the bh case, here we abuse b_inode_buffers:
 		 */
 		list_add(&bh->b_inode_buffers, &emergency_bhs);
 		nr_emergency_bhs++;
-		spin_unlock_irq(&emergency_lock);
+		spin_unlock_irqrestore(&emergency_lock, flags);
 	}
 }
 
@@ -297,6 +298,12 @@
 	spin_unlock_irq(&emergency_lock);
 	if (page)
 		return page;
+
+	run_task_queue(&tq_disk);
+
+	current->policy |= SCHED_YIELD;
+	__set_current_state(TASK_RUNNING);
+	schedule();
 	goto repeat_alloc;
 }
 
@@ -328,6 +335,12 @@
 	spin_unlock_irq(&emergency_lock);
 	if (bh)
 		return bh;
+
+	run_task_queue(&tq_disk);
+
+	current->policy |= SCHED_YIELD;
+	__set_current_state(TASK_RUNNING);
+	schedule();
 	goto repeat_alloc;
 }
 

  reply	other threads:[~2001-02-26 20:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-26  1:21 64GB option broken in 2.4.2 Rico Tudor
2001-02-26  1:32 ` Alan Cox
2001-02-26  8:44   ` Rico Tudor
2001-02-26 11:14     ` Alan Cox
2001-02-26 17:10     ` Andrea Arcangeli
2001-02-26 20:44       ` Ingo Molnar [this message]
2001-02-26 23:41         ` [patch] highmem-2.4.2-A0 Andrea Arcangeli
2001-02-27  2:32       ` 64GB option broken in 2.4.2 Rico Tudor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.30.0102262139420.7414-200000@elte.hu \
    --to=mingo@elte.hu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rico@patrec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).