All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Cygwin can't handle huge packfiles?
From: Christopher Faylor @ 2006-04-06  0:34 UTC (permalink / raw)
  To: git
In-Reply-To: <20060405232739.GA18121@nospam.com>

On Thu, Apr 06, 2006 at 01:27:39AM +0200, Rutger Nijlunsing wrote:
>On Wed, Apr 05, 2006 at 05:08:44PM -0400, Christopher Faylor wrote:
>> On Wed, Apr 05, 2006 at 04:14:20PM +0200, Johannes Schindelin wrote:
>> >> Inspired by a patch of Alex Riesen (thanks, Alex), I tried to use the
>> >> regular mmap for mapping pack files, only to discover that I compile
>> >> without defining "NO_MMAP", so I've been using the stock mmap all
>> >> along. So now I'm thinking that the cygwin mmap also does a
>> >> malloc-and-read, just like git does with NO_MMAP. So I'll continue to
>> >> investigate in that direction.
>> >
>> >I think cygwin's mmap() is based on the Win32 API equivalent, which could 
>> >mean that it *is* memory mapped, but in a special area (which is smaller 
>> >than 1.5 gigabyte). In this case, it would make sense to limit the pack 
>> >size, thereby having several packs, and mmap() them as they are needed.
>> 
>> Yes, cygwin's mmap uses CreateFileMapping and MapViewOfFile.  IIRC,
>> Windows might have a 2G limitation lurking under the hood somewhere but
>> I think that might be tweakable with some registry setting.
>
>Windows places its DLLs criss-cross through the memory space because
>every DLL on the system has its own preferred place to be loaded (the
>base address). This severely limits the amount of largest contiguous
>memory block available, which is needed for one mmap() I think.
>
>Several solutions exist:
>  - enlarge the address space with the /3GB boot flag in boot.ini

Thanks.  The 3GB boot flag is what I was trying to remember.

>  - rebase all DLLs with REBASE.EXE (part of platform sdk) .
>    Just make them the same and fix them to a low address.
>    Problem is rebasing system dlls since those are locked by the system.

Cygwin has its own version of rebase and a method for rebasing all of the
dlls in the distribution.  Using that may help squeeze out a little bit
of memory.

>  - at start of program before other DLLs are loaded,
>    reserve an as large part of the memory as possible with
>    VirtualAlloc()

Cygwin actually uses this trick to try to push DLLs into their right
locations after a fork.  It sort of works but sometimes, in a child
proccess, Windows puts "stuff" in locations previously occupied by a
DLL.  I could swear that it does that just to be annoying...

There is a chicken/egg problem here in that Cygwin uses Doug Lea's malloc
and that version of malloc will use mmap when sbrk() fails -- as it is
apt to do when allocating gigabytes of memory.  So, using malloc is
not a way to avoid mmap.

cgf

^ permalink raw reply

* Re: [e1000 debug] KERNEL: assertion (!sk_forward_alloc) failed...
From: Jesse Brandeburg @ 2006-04-06  0:42 UTC (permalink / raw)
  To: Jesse Brandeburg
  Cc: Boris B. Zhmurov, Phil Oester, Mark Nipper, Herbert Xu,
	David S. Miller, jrlundgren, cat, djani22, yoseph.basri, mykleb,
	olel, michal, chris, netdev, jesse.brandeburg, E1000-devel,
	Andi Kleen, Jeff Garzik
In-Reply-To: <Pine.WNT.4.63.0604051500530.2496@jbrandeb-desk.amr.corp.intel.com>

On Wed, 5 Apr 2006, Jesse Brandeburg wrote:

> I'll also send a patch today to back-rev the xmit routine to the 5.6.10.1 
> state.

I'm in a bit of a hurry, but I wanted to send these debug patches out.  
Forgive me if my mailer decides to munge them.
I'd suggest trying the first one and then both together.
The first fixes up the tso function only to be like 5.6.10.1-k2.
The second builds on the first, and incorporates more of the tx changes.
  
I built and tested the driver with patches on 2.6.16, with pci-x adapters.  
I removed some workarounds for PCIe adapters, but I dont think anyone 
having this problem has a PCIe adapter anyway.  I saw no TX hangs and ran 
some bi-directional tests, so i think the driver should work okay.  Just 
warning you I did minimal testing.

*********************
e1000: transmit the old fashioned way

It seems back in the day of 2.6.11, there were no sk_forward_alloc
asserions.  Forward port that transmit code to see if it fixes the issues
in today's kernel.  Unfortunately it doesn't have all the bug fixes that
the current code has, but if we get transmit timeouts we can add in
workarounds appropriately.

this changes only the e1000_tso function

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

---

 drivers/net/e1000/e1000_main.c |   37 ++++++-------------------------------
 1 files changed, 6 insertions(+), 31 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
old mode 100644
new mode 100755
index e3d3778..2b8fb87
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2519,57 +2519,34 @@ e1000_tso(struct e1000_adapter *adapter,
 {
 #ifdef NETIF_F_TSO
 	struct e1000_context_desc *context_desc;
-	struct e1000_buffer *buffer_info;
 	unsigned int i;
 	uint32_t cmd_length = 0;
 	uint16_t ipcse = 0, tucse, mss;
 	uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
-	int err;
 
 	if (skb_shinfo(skb)->tso_size) {
-		if (skb_header_cloned(skb)) {
-			err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
-			if (err)
-				return err;
-		}
-
 		hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
 		mss = skb_shinfo(skb)->tso_size;
-		if (skb->protocol == ntohs(ETH_P_IP)) {
-			skb->nh.iph->tot_len = 0;
-			skb->nh.iph->check = 0;
-			skb->h.th->check =
-				~csum_tcpudp_magic(skb->nh.iph->saddr,
+		skb->nh.iph->tot_len = 0;
+		skb->nh.iph->check = 0;
+		skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr,
 						   skb->nh.iph->daddr,
 						   0,
 						   IPPROTO_TCP,
 						   0);
-			cmd_length = E1000_TXD_CMD_IP;
-			ipcse = skb->h.raw - skb->data - 1;
-#ifdef NETIF_F_TSO_IPV6
-		} else if (skb->protocol == ntohs(ETH_P_IPV6)) {
-			skb->nh.ipv6h->payload_len = 0;
-			skb->h.th->check =
-				~csum_ipv6_magic(&skb->nh.ipv6h->saddr,
-						 &skb->nh.ipv6h->daddr,
-						 0,
-						 IPPROTO_TCP,
-						 0);
-			ipcse = 0;
-#endif
-		}
 		ipcss = skb->nh.raw - skb->data;
 		ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data;
+		ipcse = skb->h.raw - skb->data - 1;
 		tucss = skb->h.raw - skb->data;
 		tucso = (void *)&(skb->h.th->check) - (void *)skb->data;
 		tucse = 0;
 
 		cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
-			       E1000_TXD_CMD_TCP | (skb->len - (hdr_len)));
+			       E1000_TXD_CMD_IP | E1000_TXD_CMD_TCP |
+			       (skb->len - (hdr_len)));
 
 		i = tx_ring->next_to_use;
 		context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
-		buffer_info = &tx_ring->buffer_info[i];
 
 		context_desc->lower_setup.ip_fields.ipcss  = ipcss;
 		context_desc->lower_setup.ip_fields.ipcso  = ipcso;
@@ -2581,8 +2558,6 @@ e1000_tso(struct e1000_adapter *adapter,
 		context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
 		context_desc->cmd_and_length = cpu_to_le32(cmd_length);
 
-		buffer_info->time_stamp = jiffies;
-
 		if (++i == tx_ring->count) i = 0;
 		tx_ring->next_to_use = i;
 



*************************************


e1000: implement old xmit_frame

It seems back in the day of 2.6.11, there were no sk_forward_alloc
asserions.  Forward port that transmit code to see if it fixes the issues
in today's kernel.  Unfortunately it doesn't have all the bug fixes that
the current code has, but if we get transmit timeouts we can add in
workarounds appropriately.

this changes the e1000_xmit_frame function, and some ancilliaries

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

---

 drivers/net/e1000/e1000_main.c |   90 ++--------------------------------------
 1 files changed, 4 insertions(+), 86 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 2b8fb87..18790b6 100755
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2725,10 +2725,7 @@ e1000_tx_queue(struct e1000_adapter *ada
 	if (likely(tx_flags & E1000_TX_FLAGS_TSO)) {
 		txd_lower |= E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D |
 		             E1000_TXD_CMD_TSE;
-		txd_upper |= E1000_TXD_POPTS_TXSM << 8;
-
-		if (likely(tx_flags & E1000_TX_FLAGS_IPV4))
-			txd_upper |= E1000_TXD_POPTS_IXSM << 8;
+		txd_upper |= (E1000_TXD_POPTS_IXSM | E1000_TXD_POPTS_TXSM) << 8;
 	}
 
 	if (likely(tx_flags & E1000_TX_FLAGS_CSUM)) {
@@ -2803,41 +2800,6 @@ no_fifo_stall_required:
 	return 0;
 }
 
-#define MINIMUM_DHCP_PACKET_SIZE 282
-static inline int
-e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
-{
-	struct e1000_hw *hw =  &adapter->hw;
-	uint16_t length, offset;
-	if (vlan_tx_tag_present(skb)) {
-		if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id) &&
-			( adapter->hw.mng_cookie.status &
-			  E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) )
-			return 0;
-	}
-	if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
-		struct ethhdr *eth = (struct ethhdr *) skb->data;
-		if ((htons(ETH_P_IP) == eth->h_proto)) {
-			const struct iphdr *ip =
-				(struct iphdr *)((uint8_t *)skb->data+14);
-			if (IPPROTO_UDP == ip->protocol) {
-				struct udphdr *udp =
-					(struct udphdr *)((uint8_t *)ip +
-						(ip->ihl << 2));
-				if (ntohs(udp->dest) == 67) {
-					offset = (uint8_t *)udp + 8 - skb->data;
-					length = skb->len - offset;
-
-					return e1000_mng_write_dhcp_info(hw,
-							(uint8_t *)udp + 8,
-							length);
-				}
-			}
-		}
-	}
-	return 0;
-}
-
 #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 )
 static int
 e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
@@ -2852,7 +2814,6 @@ e1000_xmit_frame(struct sk_buff *skb, st
 	unsigned int nr_frags = 0;
 	unsigned int mss = 0;
 	int count = 0;
- 	int tso;
 	unsigned int f;
 	len -= skb->data_len;
 
@@ -2876,44 +2837,18 @@ e1000_xmit_frame(struct sk_buff *skb, st
 	 * overrun the FIFO, adjust the max buffer len if mss
 	 * drops. */
 	if (mss) {
-		uint8_t hdr_len;
 		max_per_txd = min(mss << 2, max_per_txd);
 		max_txd_pwr = fls(max_per_txd) - 1;
-
-	/* TSO Workaround for 82571/2 Controllers -- if skb->data
-	 * points to just header, pull a few bytes of payload from
-	 * frags into skb->data */
-		hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
-		if (skb->data_len && (hdr_len == (skb->len - skb->data_len)) &&
-			(adapter->hw.mac_type == e1000_82571 ||
-			adapter->hw.mac_type == e1000_82572)) {
-			unsigned int pull_size;
-			pull_size = min((unsigned int)4, skb->data_len);
-			if (!__pskb_pull_tail(skb, pull_size)) {
-				printk(KERN_ERR "__pskb_pull_tail failed.\n");
-				dev_kfree_skb_any(skb);
-				return NETDEV_TX_OK;
-			}
-			len = skb->len - skb->data_len;
-		}
 	}
 
 	/* reserve a descriptor for the offload context */
 	if ((mss) || (skb->ip_summed == CHECKSUM_HW))
 		count++;
-	count++;
+	count++;	/* for sentinel desc */
 #else
 	if (skb->ip_summed == CHECKSUM_HW)
 		count++;
 #endif
-
-#ifdef NETIF_F_TSO
-	/* Controller Erratum workaround */
-	if (!skb->data_len && tx_ring->last_tx_tso &&
-		!skb_shinfo(skb)->tso_size)
-		count++;
-#endif
-
 	count += TXD_USE_COUNT(len, max_txd_pwr);
 
 	if (adapter->pcix_82544)
@@ -2933,9 +2868,6 @@ e1000_xmit_frame(struct sk_buff *skb, st
 	if (adapter->pcix_82544)
 		count += nr_frags;
 
-	if (adapter->hw.tx_pkt_filtering && (adapter->hw.mac_type == e1000_82573) )
-		e1000_transfer_dhcp_info(adapter, skb);
-
 	local_irq_save(flags);
 	if (!spin_trylock(&tx_ring->tx_lock)) {
 		/* Collision - tell upper layer to requeue */
@@ -2967,25 +2899,11 @@ e1000_xmit_frame(struct sk_buff *skb, st
 
 	first = tx_ring->next_to_use;
 
-	tso = e1000_tso(adapter, tx_ring, skb);
-	if (tso < 0) {
-		dev_kfree_skb_any(skb);
-		spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
-		return NETDEV_TX_OK;
-	}
-
-	if (likely(tso)) {
-		tx_ring->last_tx_tso = 1;
+	if(likely(e1000_tso(adapter, tx_ring, skb)))
 		tx_flags |= E1000_TX_FLAGS_TSO;
-	} else if (likely(e1000_tx_csum(adapter, tx_ring, skb)))
+	else if(likely(e1000_tx_csum(adapter, tx_ring, skb)))
 		tx_flags |= E1000_TX_FLAGS_CSUM;
 
-	/* Old method was to assume IPv4 packet by default if TSO was enabled.
-	 * 82571 hardware supports TSO capabilities for IPv6 as well...
-	 * no longer assume, we must. */
-	if (likely(skb->protocol == ntohs(ETH_P_IP)))
-		tx_flags |= E1000_TX_FLAGS_IPV4;
-
 	e1000_tx_queue(adapter, tx_ring, tx_flags,
 	               e1000_tx_map(adapter, tx_ring, skb, first,
 	                            max_per_txd, nr_frags, mss));


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply related

* Re: [patch 1/3] mm: An enhancement of OVERCOMMIT_GUESS
From: KAMEZAWA Hiroyuki @ 2006-04-06  0:45 UTC (permalink / raw)
  To: Hideo AOKI; +Cc: akpm, linux-kernel, linux-mm
In-Reply-To: <4434570F.9030507@redhat.com>


Hi, AOKI-san

On Wed, 05 Apr 2006 19:47:27 -0400
Hideo AOKI <haoki@redhat.com> wrote:

> Hello Andrew,
> 
> Could you apply my patches to your tree?
> 
> These patches are an enhancement of OVERCOMMIT_GUESS algorithm in
> __vm_enough_memory(). The detailed description is in attached patch.
> 

I think adding a function like this is more simple way.
(call this istead of nr_free_pages().)
==
int nr_available_memory() 
{
	unsigned long sum = 0;
	for_each_zone(zone) {
		if (zone->free_pages > zone->pages_high)
			sum += zone->free_pages - zone->pages_high;
	}
	return sum;
}
==

BTW, vm_enough_memory() doesn't eat cpuset information ?

-Kame


^ permalink raw reply

* Re: [patch 1/3] mm: An enhancement of OVERCOMMIT_GUESS
From: KAMEZAWA Hiroyuki @ 2006-04-06  0:45 UTC (permalink / raw)
  To: Hideo AOKI; +Cc: akpm, linux-kernel, linux-mm
In-Reply-To: <4434570F.9030507@redhat.com>

Hi, AOKI-san

On Wed, 05 Apr 2006 19:47:27 -0400
Hideo AOKI <haoki@redhat.com> wrote:

> Hello Andrew,
> 
> Could you apply my patches to your tree?
> 
> These patches are an enhancement of OVERCOMMIT_GUESS algorithm in
> __vm_enough_memory(). The detailed description is in attached patch.
> 

I think adding a function like this is more simple way.
(call this istead of nr_free_pages().)
==
int nr_available_memory() 
{
	unsigned long sum = 0;
	for_each_zone(zone) {
		if (zone->free_pages > zone->pages_high)
			sum += zone->free_pages - zone->pages_high;
	}
	return sum;
}
==

BTW, vm_enough_memory() doesn't eat cpuset information ?

-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [ANNOUNCE] udev 089 release
From: juuso.alasuutari @ 2006-04-06  0:54 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <20060403171123.GA24860@vrfy.org>

Quoting Scott James Remnant <scott@ubuntu.com>:

> > If you can convince me why we would want to filter out events on the
> > event generation side instead of doing that on the event handling side.
> > I'm not sure about the idea of controlling the module load order or the
> > other weird things that way, but you may may have good reasons I don't
> > see at the moment.
> >
> The principal reason for us at the moment is in the initramfs; in the
> main system we just plug everything and let the order be damned.
> Indeed, wherever we've found a situation where a module load order is
> necessary (I know of three or four I think at the moment) we've decided
> that the bug is in the driver for requiring that order.

I just wanted to pop in to confirm that network device modules loading in random
order can be a pain. When interfaces are not always named in the same order,
things can become more complicated than they should be.
This can of course be avoided with rules that bind MAC addresses to fixed names,
but it would be much nicer to have a predictable loading order.

Juuso

----------------------------------------------------------------
This mail sent through L-secure: http://www.l-secure.net/



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply

* Re: [stable] Re: [patch 02/26] USB: Fix irda-usb use after use
From: Greg KH @ 2006-04-06  0:55 UTC (permalink / raw)
  To: David S. Miller
  Cc: gregkh, torvalds, tytso, zwane, jmforbes, linux-kernel, rdunlap,
	eugene.teo, davej, chuckw, stable, alan
In-Reply-To: <20060404.171644.12655459.davem@davemloft.net>

On Tue, Apr 04, 2006 at 05:16:44PM -0700, David S. Miller wrote:
> From: gregkh@suse.de
> Date: Tue, 4 Apr 2006 16:59:43 -0700
> 
> > Don't read from free'd memory after calling netif_rx().  docopy is used as
> > a boolean (0 and 1) so unsigned int is sufficient.
> > 
> > Coverity bug #928
> > 
> > Signed-off-by: Eugene Teo <eugene.teo@eugeneteo.net>
> > Cc: "David Miller" <davem@davemloft.net>
> > Signed-off-by: Andrew Morton <akpm@osdl.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>

Thanks, I've added this to the patch.

greg k-h

^ permalink raw reply

* Re: USB 2.0 CF card reader gets reset+offlined immediately with 2.6.16
From: Greg KH @ 2006-04-06  0:59 UTC (permalink / raw)
  To: Bernhard Rosenkraenzer, linux-usb-devel; +Cc: linux-kernel
In-Reply-To: <200604060012.04300.bero@arklinux.org>

On Thu, Apr 06, 2006 at 12:12:04AM +0200, Bernhard Rosenkraenzer wrote:
> Attempting to use a USB 2.0 CF card reader in 2.6.16 and 2.6.16-mm2 (known to 
> work back in 2.4 days, unused since) results in this:

Can you enable CONFIG_USB_STORAGE_DEBUG and send the kernel log file to
the linux-usb-devel mailing list so the people there can help you out?

thanks,

greg k-h

<linux-usb-devel people, here's the original log>

> usb 1-6: new high speed USB device using ehci_hcd and address 2
> usb 1-6: new device found, idVendor=0dda, idProduct=2005
> usb 1-6: new device strings: Mfr=3, Product=4, SerialNumber=5
> usb 1-6: Product: Card Reader
> usb 1-6: Manufacturer: Hama
> usb 1-6: SerialNumber: 000000000013
> usb 1-6: configuration #1 chosen from 1 choice
> usbcore: registered new driver libusual
> Initializing USB Mass Storage driver...
> scsi0 : SCSI emulation for USB Mass Storage devices
> usbcore: registered new driver usb-storage
> USB Mass Storage support registered.
> usb-storage: device found at 2
> usb-storage: waiting for device to settle before scanning
>   Vendor: Hama      Model: CF  Card Reader   Rev: 9317
>   Type:   Direct-Access                      ANSI SCSI revision: 00
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> sd 0:0:0:0: scsi: Device offlined - not ready after error recovery
> sd 0:0:0:0: rejecting I/O to offline device
> sd 0:0:0:0: rejecting I/O to offline device
> sd 0:0:0:0: rejecting I/O to offline device
> sda : READ CAPACITY failed.
> sda : status=0, message=00, host=1, driver=00
> sda : sense not available.
> sd 0:0:0:0: rejecting I/O to offline device
> sda: Write Protect is off
> sda: Mode Sense: 00 00 00 00
> sda: assuming drive cache: write through
> sd 0:0:0:0: Attached scsi removable disk sda
>   Vendor: Hama      Model: SM  Card Reader   Rev: 9317
>   Type:   Direct-Access                      ANSI SCSI revision: 00
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> sd 0:0:0:1: scsi: Device offlined - not ready after error recovery
> sd 0:0:0:1: rejecting I/O to offline device
> sd 0:0:0:1: rejecting I/O to offline device
> sd 0:0:0:1: rejecting I/O to offline device
> sdb : READ CAPACITY failed.
> sdb : status=0, message=00, host=1, driver=00
> sdb : sense not available.
> sd 0:0:0:1: rejecting I/O to offline device
> sdb: Write Protect is off
> sdb: Mode Sense: 00 00 00 00
> sdb: assuming drive cache: write through
> sd 0:0:0:1: Attached scsi removable disk sdb
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
>   Vendor: Hama      Model: SD  Card Reader   Rev: 9317
>   Type:   Direct-Access                      ANSI SCSI revision: 00
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> sd 0:0:0:2: scsi: Device offlined - not ready after error recovery
> sd 0:0:0:2: rejecting I/O to offline device
> sd 0:0:0:2: rejecting I/O to offline device
> sd 0:0:0:2: rejecting I/O to offline device
> sdc : READ CAPACITY failed.
> sdc : status=0, message=00, host=1, driver=00
> sdc : sense not available.
> sd 0:0:0:2: rejecting I/O to offline device
> sdc: Write Protect is off
> sdc: Mode Sense: 00 00 00 00
> sdc: assuming drive cache: write through
> sd 0:0:0:2: Attached scsi removable disk sdc
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
>   Vendor: Hama      Model: MS  Card Reader   Rev: 9317
>   Type:   Direct-Access                      ANSI SCSI revision: 00
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> usb 1-6: reset high speed USB device using ehci_hcd and address 2
> sd 0:0:0:3: scsi: Device offlined - not ready after error recovery
> sd 0:0:0:3: rejecting I/O to offline device
> sd 0:0:0:3: rejecting I/O to offline device
> sd 0:0:0:3: rejecting I/O to offline device
> sdd : READ CAPACITY failed.
> sdd : status=0, message=00, host=1, driver=00
> sdd : sense not available.
> sd 0:0:0:3: rejecting I/O to offline device
> sdd: Write Protect is off
> sdd: Mode Sense: 00 00 00 00
> sdd: assuming drive cache: write through
> sd 0:0:0:3: Attached scsi removable disk sdd
> usb-storage: device scan complete
> 
> 
> Any attempt to access the devices afterwards results in ENXIO (but 
> the /sys/block entries for sda to sdd remain there).

^ permalink raw reply

* Re: [patch 03/26] sysfs: zero terminate sysfs write buffers (CVE-2006-1055)
From: Al Viro @ 2006-04-06  1:05 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Jon Smirl, gregkh, linux-kernel, stable
In-Reply-To: <200604051958.k35JwF0M019652@turing-police.cc.vt.edu>

On Wed, Apr 05, 2006 at 03:58:15PM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Wed, 05 Apr 2006 16:39:57 BST, Al Viro said:
> 
> > How about _NOT_ using sysfs and just having ->read()/->write() on a file in fs
> > of your own?  ~20 lines for all of it, not counting #include...
> 
> Great.  Instead of everybody using the same piece-of-manure sysfs interface,
> each driver carries around its 20 lines to implement read() and write() in
> subtly buggy and incompatible ways.

No, that would be 20 lines to tell what and where you want in that fs and
how long should the things live.  Plus whatever you've got for your ->read()
and ->write() - using existing libfs helpers if needed.  Instead of pushing
into sysfs the things that do not fit sysfs interfaces.

BTW, in my experience "subtly buggy and incompatible ways" describes sysfs
uses, except that there's rarely anything subtle about that.  Care to name
four kernel data structures that got kobjects embedded into them (directly
or via struct device and it ilk) and had _NOT_ required at one point or
another (post-merge) fixing of blatant user-exploitable holes due to botched
lifetime rules?

Not that you had to embed them to achieve the same wonderful effect -
witness fbsysfs.c user-exploitable holes on unregister_framebuffer();
sure, fb_info->class_device will stay allocated if you have one of the
attributes opened.  Now try to call read(); what will it access?

Not to mention that the same file has a pile of ->store() assuming we
have NUL-termination, or the lovely use of sscanf() on non-NUL-terminated
array right in store_cmap() itself.  Equivalent of
	p = malloc(5);
	if (p) {
		memcpy(p, q, 5);
		sscanf(p, "%4hx", &v);
	}
You do realize that it's broken, don't you?  sscanf field width for %x
applies _after_ skipping the whitespace, not to the total amount of
characters being eaten.  And in reality this buffer comes from the end
of get_zeroed_page() result, so there's really nothing past its end.

^ permalink raw reply

* Re: patch bus_add_device-losing-an-error-return-from-the-probe-method.patch added to gregkh-2.6 tree
From: Greg KH @ 2006-04-06  1:05 UTC (permalink / raw)
  To: Dmitry Torokhov, Greg KH, rene.herman, alsa-devel, linux-kernel,
	tiwai
In-Reply-To: <20060405073602.GA1380@flint.arm.linux.org.uk>

On Wed, Apr 05, 2006 at 08:36:02AM +0100, Russell King wrote:
> On Tue, Apr 04, 2006 at 09:35:40PM -0400, Dmitry Torokhov wrote:
> > On Tuesday 04 April 2006 17:45, Greg KH wrote:
> > > Ah, I see what you are saying now.  Yeah, we should still add the
> > > default attributes for the bus and create the bus link even if some
> > > random driver had problems.  But then, we should still propagate the
> > > error back up, right?
> > 
> > I don't think so because device creation did not fail. Otherwise how
> > would you as a caller of device_register() distinguish between the
> > following 2 scenarios:
> > 
> >  - you got -ENOMEM (or other error code) because device creation
> >    indeed failed;
> >  - you got -ENOMEM because some odd driver could not allocate 4MB
> >    of memory.
> > 
> > IOW you trying to propagate driver error to device creation code...
> > 
> > Also result of device_register() should not depend on whether
> > driver_register() was called earlier or not.
> 
> Indeed.  Greg - this patch is bogus.

You and Dmitry are correct.  I'm dropping this patch.  The ISA drivers
just need to get used to the proper way to use the driver model (they do
not know if they have been bound to a device when the driver is loaded,
no big deal).

If there's other issues with platform devices still, without this patch
applied, please let me know.

thanks to you all for pointing out the real issues here.

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply

* Re: patch bus_add_device-losing-an-error-return-from-the-probe-method.patch added to gregkh-2.6 tree
From: Greg KH @ 2006-04-06  1:05 UTC (permalink / raw)
  To: Dmitry Torokhov, Greg KH, rene.herman, alsa-devel, linux-kernel,
	tiwai
In-Reply-To: <20060405073602.GA1380@flint.arm.linux.org.uk>

On Wed, Apr 05, 2006 at 08:36:02AM +0100, Russell King wrote:
> On Tue, Apr 04, 2006 at 09:35:40PM -0400, Dmitry Torokhov wrote:
> > On Tuesday 04 April 2006 17:45, Greg KH wrote:
> > > Ah, I see what you are saying now.  Yeah, we should still add the
> > > default attributes for the bus and create the bus link even if some
> > > random driver had problems.  But then, we should still propagate the
> > > error back up, right?
> > 
> > I don't think so because device creation did not fail. Otherwise how
> > would you as a caller of device_register() distinguish between the
> > following 2 scenarios:
> > 
> >  - you got -ENOMEM (or other error code) because device creation
> >    indeed failed;
> >  - you got -ENOMEM because some odd driver could not allocate 4MB
> >    of memory.
> > 
> > IOW you trying to propagate driver error to device creation code...
> > 
> > Also result of device_register() should not depend on whether
> > driver_register() was called earlier or not.
> 
> Indeed.  Greg - this patch is bogus.

You and Dmitry are correct.  I'm dropping this patch.  The ISA drivers
just need to get used to the proper way to use the driver model (they do
not know if they have been bound to a device when the driver is loaded,
no big deal).

If there's other issues with platform devices still, without this patch
applied, please let me know.

thanks to you all for pointing out the real issues here.

greg k-h

^ permalink raw reply

* Re: readers-writers mutex
From: Arjan van de Ven @ 2006-04-06  1:06 UTC (permalink / raw)
  To: Joshua Hudson; +Cc: linux-kernel
In-Reply-To: <bda6d13a0604051521o229de77dvb38992d6427a450c@mail.gmail.com>

On Wed, 2006-04-05 at 15:21 -0700, Joshua Hudson wrote:
> Since we are moving from semaphores to mutex, there should be a
> mutex_rw.

should there really? We discussed this briefly during the mutex work
the conclusion was that rw_sems
1) are rare (thankfully; they're highly expensive)
2) do not have mutex semantics

so... can you explain how your rw_mutex is behaving different from an
rw_sem, and can you explain what the gains are for that conversion?
(eg for mutex it was better defined semantics, lots better debugging
(possible due to the semantics) and more performance). What is that for
rw_mutex ?



^ permalink raw reply

* [PATCH] mm: limit lowmem_reserve
From: Con Kolivas @ 2006-04-06  1:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: ck, Nick Piggin, linux list, linux-mm
In-Reply-To: <200604041235.59876.kernel@kolivas.org>

It is possible with a low enough lowmem_reserve ratio to make
zone_watermark_ok always fail if the lower_zone is small enough.
Impose a lower limit on the ratio to only allow 1/4 of the lower_zone
size to be set as lowmem_reserve. This limit is hit in ZONE_DMA by changing
the default vmsplit on i386 even without changing the default sysctl values.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

---
 mm/page_alloc.c |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

Index: linux-2.6.17-rc1-mm1/mm/page_alloc.c
===================================================================
--- linux-2.6.17-rc1-mm1.orig/mm/page_alloc.c	2006-04-06 10:32:31.000000000 +1000
+++ linux-2.6.17-rc1-mm1/mm/page_alloc.c	2006-04-06 11:09:17.000000000 +1000
@@ -2566,14 +2566,32 @@ static void setup_per_zone_lowmem_reserv
 			zone->lowmem_reserve[j] = 0;
 
 			for (idx = j-1; idx >= 0; idx--) {
+				unsigned long max_reserve;
+				unsigned long reserve;
 				struct zone *lower_zone;
 
+				lower_zone = pgdat->node_zones + idx;
+				/*
+				 * Put an upper limit on the reserve at 1/4
+				 * the lower_zone size. This prevents large
+				 * zone size differences such as 3G VMSPLIT
+				 * or low sysctl values from making
+				 * zone_watermark_ok always fail. This
+				 * enforces a lower limit on the reserve_ratio
+				 */
+				max_reserve = lower_zone->present_pages / 4;
+
 				if (sysctl_lowmem_reserve_ratio[idx] < 1)
 					sysctl_lowmem_reserve_ratio[idx] = 1;
-
-				lower_zone = pgdat->node_zones + idx;
-				lower_zone->lowmem_reserve[j] = present_pages /
+				reserve = present_pages /
 					sysctl_lowmem_reserve_ratio[idx];
+				if (reserve > max_reserve) {
+					reserve = max_reserve;
+					sysctl_lowmem_reserve_ratio[idx] =
+						present_pages / max_reserve;
+				}
+
+				lower_zone->lowmem_reserve[j] = reserve;
 				present_pages += lower_zone->present_pages;
 			}
 		}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* [PATCH] mm: limit lowmem_reserve
From: Con Kolivas @ 2006-04-06  1:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: ck, Nick Piggin, linux list, linux-mm
In-Reply-To: <200604041235.59876.kernel@kolivas.org>

It is possible with a low enough lowmem_reserve ratio to make
zone_watermark_ok always fail if the lower_zone is small enough.
Impose a lower limit on the ratio to only allow 1/4 of the lower_zone
size to be set as lowmem_reserve. This limit is hit in ZONE_DMA by changing
the default vmsplit on i386 even without changing the default sysctl values.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

---
 mm/page_alloc.c |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

Index: linux-2.6.17-rc1-mm1/mm/page_alloc.c
===================================================================
--- linux-2.6.17-rc1-mm1.orig/mm/page_alloc.c	2006-04-06 10:32:31.000000000 +1000
+++ linux-2.6.17-rc1-mm1/mm/page_alloc.c	2006-04-06 11:09:17.000000000 +1000
@@ -2566,14 +2566,32 @@ static void setup_per_zone_lowmem_reserv
 			zone->lowmem_reserve[j] = 0;
 
 			for (idx = j-1; idx >= 0; idx--) {
+				unsigned long max_reserve;
+				unsigned long reserve;
 				struct zone *lower_zone;
 
+				lower_zone = pgdat->node_zones + idx;
+				/*
+				 * Put an upper limit on the reserve at 1/4
+				 * the lower_zone size. This prevents large
+				 * zone size differences such as 3G VMSPLIT
+				 * or low sysctl values from making
+				 * zone_watermark_ok always fail. This
+				 * enforces a lower limit on the reserve_ratio
+				 */
+				max_reserve = lower_zone->present_pages / 4;
+
 				if (sysctl_lowmem_reserve_ratio[idx] < 1)
 					sysctl_lowmem_reserve_ratio[idx] = 1;
-
-				lower_zone = pgdat->node_zones + idx;
-				lower_zone->lowmem_reserve[j] = present_pages /
+				reserve = present_pages /
 					sysctl_lowmem_reserve_ratio[idx];
+				if (reserve > max_reserve) {
+					reserve = max_reserve;
+					sysctl_lowmem_reserve_ratio[idx] =
+						present_pages / max_reserve;
+				}
+
+				lower_zone->lowmem_reserve[j] = reserve;
 				present_pages += lower_zone->present_pages;
 			}
 		}

^ permalink raw reply

* RE: PAE dom0 is broken with the default config
From: Kamble, Nitin A @ 2006-04-06  1:11 UTC (permalink / raw)
  To: Ian Pratt, Keir.Fraser; +Cc: xen-devel

   I did rebuild the initrd for the new kernel/modules. The system has
sata disk. scsi driver is the same ata_piix, libata. The same config is
working fine for the non-PAE build. 
   The VMX status report mail says PAE is fine, but they are not using
the default (linux-defconfig_xen_x86_32) config. They are using the xen0
config for PAE testing. What config do you use for your PAE testing?

In summary here is my observation
PAE build with linux-defconfig_xen_x86_32 config:	dom0 does not
boot
PAE build with linux-defconfig_xen0_x86_32 config:	boots
Non-PAE build with either config:				boots

All of the above kernels need corresponding initrd to boot.

Thanks & Regards,
Nitin
------------------------------------------------------------------------
-----------
Open Source Technology Center, Intel Corp

>-----Original Message-----
>From: Ian Pratt [mailto:m+Ian.Pratt@cl.cam.ac.uk]
>Sent: Wednesday, April 05, 2006 4:34 PM
>To: Kamble, Nitin A; Keir.Fraser@cl.cam.ac.uk
>Cc: xen-devel@lists.xensource.com; ian.pratt@cl.cam.ac.uk
>Subject: RE: PAE dom0 is broken with the default config
>
>>   I built PAE Xen with the default config, and it is not
>> booting. Log is bellow. If I replace the
>> linux-defconfig_xen_x86_32 file with the
>> linux-defconfig_xen0_x86_32 before building then dom0 is able
>> to boot and see more than 4Gig memory. This looks like a dom0
>> kernel config issue. Do you care PAE dom0 for 3.0.2 with the
>> default config? Is anybody working on this?
>
>This seems pretty unlikely to be a PAE issue -- we do quite extensive
>testing.
>
>Are you sure you have the right initrd? Is the same scsi driver being
>used as in the -xen0 case?
>
>Thanks,
>Ian
>
>>
>>
>> IP route cache hash table entries: 262144 (order: 8, 1048576 bytes)
>>
>> TCP established hash table entries: 524288 (order: 10, 4194304 bytes)
>>
>> TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
>>
>> TCP: Hash tables configured (established 524288 bind 65536)
>>
>> TCP reno registered
>>
>> NET: Registered protocol family 8
>>
>> NET: Registered protocol family 20
>>
>> Using IPI No-Shortcut mode
>>
>> Freeing unused kernel memory: 172k freed
>>
>> scsi_mod: no version for "struct_module" found: kernel tainted.
>>
>> SCSI subsystem initialized
>>
>> ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 17
>>
>> ata1: SATA max UDMA/133 cmd 0x0 ctl 0xC402 bmdma 0xBC00 irq 17
>>
>> ata2: SATA max UDMA/133 cmd 0x0 ctl 0xC002 bmdma 0xBC08 irq 17
>>
>> ata1: dev 0 ATA-6, max UDMA/133, 312581808 sectors: LBA48
>>
>> ata1: dev 0 configured for UDMA/133
>>
>> scsi0 : ata_piix
>>
>> ATA: abnormal status 0x7F on port 0xC087
>>
>> scsi1 : ata_piix
>>
>>   Vendor: ATA       Model: ST3160023AS       Rev: 3.00
>>
>>   Type:   Direct-Access                      ANSI SCSI revision: 05
>>
>> SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)
>>
>> sda: Write Protect is off
>>
>> SCSI device sda: drive cache: write back
>>
>> SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)
>>
>> sda: Write Protect is off
>>
>> SCSI device sda: drive cache: write back
>>
>>  sda: unknown partition table
>>
>> sd 0:0:0:0: Attached scsi disk sda
>>
>> Kernel panic - not syncing: Attempted to kill init!
>>
>>  (XEN) Domain 0 crashed: rebooting machine in 5 seconds.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

^ permalink raw reply

* Re: OOM kills if swappiness set to 0, swap storms otherwise
From: Shantanu Goel @ 2006-04-06  1:13 UTC (permalink / raw)
  To: Charles Shannon Hendrix, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1590 bytes --]

Charles,

Can you please try the attached patch against 2.6.16.1
which I use on my desktop since I encountered the same
issues when running GNOME/Firefox etc.  After booting
the patched kernel, leave swappiness unchanged but do
the following:

  echo 1 > /proc/sys/vm/mapped_bias

This should allow mapped memory to stay pretty close
to 80% as implied by the default swappiness value of
60 and prevent the swap storms.

Andrew et al, details on the patch are as follows.

1. Unmapped pages are kept the inactive list as much
as possible.

2. Only partially written pages are marked as
referenced so kswapd can initiate writeback on the
first scan for sequentially written files.

3. The scanner will set PG_reclaim for pages found in
writeback.

4. The scanner will scan the LRU twice.  On the first
pass, the distress logic is disabled while on the
second pass, it is applied as before.  This permits a
full scan of the inactive list before distress
swapping begins.

5. The slab scanner only takes into account the size
of the inactive list and scans the slab at 1/2 the
rate of the inactive list for DEFAULT_SEEKS.  This
prevents spurious pageouts during heavy slab usage
such as when running updatedb.

6. reclaim_mapped is made part of scan_control so it
can be used by shrink_list() in addition to
refill_inactive_zone() to prevent mapped memory
reclamation and staying within the bounds dictated by
swappiness.

Thanks,
Shantanu

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[-- Attachment #2: 2495889862-01-mapped-bias.patch --]
[-- Type: application/octet-stream, Size: 14057 bytes --]

--- .orig/include/linux/swap.h	2006-04-05 20:29:09.000000000 -0400
+++ 01-mapped-bias/include/linux/swap.h	2006-04-03 19:25:15.000000000 -0400
@@ -175,6 +175,7 @@
 extern int try_to_free_pages(struct zone **, gfp_t);
 extern int shrink_all_memory(int);
 extern int vm_swappiness;
+extern int vm_mapped_bias;
 
 #ifdef CONFIG_NUMA
 extern int zone_reclaim_mode;
--- .orig/include/linux/sysctl.h	2006-04-05 20:29:09.000000000 -0400
+++ 01-mapped-bias/include/linux/sysctl.h	2006-04-03 19:25:04.000000000 -0400
@@ -186,6 +186,7 @@
 	VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
 	VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
 	VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */
+	VM_MAPPED_BIAS=33,	/* bias reclaim towards preserving mapped memory */
 };
 
 
--- .orig/kernel/sysctl.c	2006-04-05 20:29:09.000000000 -0400
+++ 01-mapped-bias/kernel/sysctl.c	2006-04-03 19:40:49.000000000 -0400
@@ -916,6 +916,16 @@
 		.strategy	= &sysctl_jiffies,
 	},
 #endif
+	{
+		.ctl_name	= VM_MAPPED_BIAS,
+		.procname	= "mapped_bias",
+		.data		= &vm_mapped_bias,
+		.maxlen		= sizeof(vm_mapped_bias),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero,
+	},
 	{ .ctl_name = 0 }
 };
 
--- .orig/mm/filemap.c	2006-04-05 20:29:09.000000000 -0400
+++ 01-mapped-bias/mm/filemap.c	2006-04-03 19:31:07.000000000 -0400
@@ -2020,7 +2020,14 @@
 			if (status >= 0)
 				status = -EFAULT;
 		unlock_page(page);
-		mark_page_accessed(page);
+
+		/*
+		 * Only mark page accessed for partial write
+		 * when mapped bias is in effect.
+		 */
+		if (!vm_mapped_bias || offset + bytes != PAGE_CACHE_SIZE)
+			mark_page_accessed(page);
+
 		page_cache_release(page);
 		if (status < 0)
 			break;
--- .orig/mm/page_alloc.c	2006-04-05 20:29:10.000000000 -0400
+++ 01-mapped-bias/mm/page_alloc.c	2006-04-03 20:00:22.000000000 -0400
@@ -360,7 +360,6 @@
 			1 << PG_private |
 			1 << PG_locked	|
 			1 << PG_active	|
-			1 << PG_reclaim	|
 			1 << PG_slab	|
 			1 << PG_swapcache |
 			1 << PG_writeback |
@@ -518,7 +517,6 @@
 			1 << PG_locked	|
 			1 << PG_active	|
 			1 << PG_dirty	|
-			1 << PG_reclaim	|
 			1 << PG_slab    |
 			1 << PG_swapcache |
 			1 << PG_writeback |
@@ -534,7 +532,8 @@
 
 	page->flags &= ~(1 << PG_uptodate | 1 << PG_error |
 			1 << PG_referenced | 1 << PG_arch_1 |
-			1 << PG_checked | 1 << PG_mappedtodisk);
+			1 << PG_checked | 1 << PG_mappedtodisk |
+			1 << PG_reclaim);
 	set_page_private(page, 0);
 	set_page_refs(page, order);
 	kernel_map_pages(page, 1 << order, 1);
--- .orig/mm/swap.c	2006-04-05 20:29:10.000000000 -0400
+++ 01-mapped-bias/mm/swap.c	2006-04-03 19:28:55.000000000 -0400
@@ -103,12 +103,23 @@
 {
 	struct zone *zone = page_zone(page);
 
+	if (unlikely(PageReclaim(page)))
+		ClearPageReclaim(page);
+
 	spin_lock_irq(&zone->lru_lock);
 	if (PageLRU(page) && !PageActive(page)) {
-		del_page_from_inactive_list(zone, page);
-		SetPageActive(page);
-		add_page_to_active_list(zone, page);
-		inc_page_state(pgactivate);
+		/*
+		 * Never activate an unmapped page when
+		 * mapped bias is in effect.
+		 */
+		if (!vm_mapped_bias || page_mapped(page)) {
+			del_page_from_inactive_list(zone, page);
+			SetPageActive(page);
+			add_page_to_active_list(zone, page);
+			inc_page_state(pgactivate);
+		} else if (page->lru.prev != &zone->inactive_list) {
+			list_move(&page->lru, &zone->inactive_list);
+		}
 	}
 	spin_unlock_irq(&zone->lru_lock);
 }
@@ -127,6 +138,8 @@
 		ClearPageReferenced(page);
 	} else if (!PageReferenced(page)) {
 		SetPageReferenced(page);
+		if (PageReclaim(page))
+			ClearPageReclaim(page);
 	}
 }
 
--- .orig/mm/vmscan.c	2006-04-05 20:29:10.000000000 -0400
+++ 01-mapped-bias/mm/vmscan.c	2006-04-03 20:08:36.000000000 -0400
@@ -79,6 +79,12 @@
 	 * In this context, it doesn't matter that we scan the
 	 * whole list at once. */
 	int swap_cluster_max;
+
+	/* Should we reclaim mapped memory? */
+	int reclaim_mapped;
+
+	/* LRU pass */
+	int pass;
 };
 
 /*
@@ -128,6 +134,30 @@
 int vm_swappiness = 60;
 static long total_memory;
 
+/*
+ * When non-zero, place all unmapped pages on
+ * the inactive list and do not reclaim any mapped
+ * pages unless mapped memory exceeds the threshold
+ * implied by swappiness above.
+ */
+int vm_mapped_bias = 0;
+static int mapped_bias = 0;
+static atomic_t scanner_running = ATOMIC_INIT(-1);
+
+static inline void scanner_start(void)
+{
+	/*
+	 * Re-sync mapped bias on first run.
+	 */
+	if (atomic_inc_and_test(&scanner_running))
+		mapped_bias = vm_mapped_bias;
+}
+
+static inline void scanner_stop(void)
+{
+	atomic_dec(&scanner_running);
+}
+
 static LIST_HEAD(shrinker_list);
 static DECLARE_RWSEM(shrinker_rwsem);
 
@@ -199,7 +229,17 @@
 		unsigned long total_scan;
 		unsigned long max_pass = (*shrinker->shrinker)(0, gfp_mask);
 
-		delta = (4 * scanned) / shrinker->seeks;
+		/*
+		 * With mapped bias in effect, we only count
+		 * inactive pages as part of lru_pages causing
+		 * the default algorithm to be quite aggressive.
+		 * To remedy that, we scan the slabs at a fraction
+		 * of the LRU scan rate.
+		 */
+		if (!mapped_bias)
+			delta = (4 * scanned) / shrinker->seeks;
+		else
+			delta = scanned / shrinker->seeks;
 		delta *= max_pass;
 		do_div(delta, lru_pages + 1);
 		shrinker->nr += delta;
@@ -444,15 +484,28 @@
 
 		sc->nr_scanned++;
 
+		/*
+		 * Do not reclaim a mapped page unless
+		 * necessary when mapped bias is in effect.
+		 */
+		if (mapped_bias && !sc->reclaim_mapped && page_mapped(page))
+			goto do_activate_locked;
+
 		if (!sc->may_swap && page_mapped(page))
 			goto keep_locked;
 
 		/* Double the slab pressure for mapped and swapcache pages */
-		if (page_mapped(page) || PageSwapCache(page))
+		if (!mapped_bias && (page_mapped(page) || PageSwapCache(page)))
 			sc->nr_scanned++;
 
-		if (PageWriteback(page))
+		if (PageWriteback(page)) {
+			/*
+			 * Set reclaim bit when mapped bias is in effect.
+			 */
+			if (mapped_bias)
+				SetPageReclaim(page);
 			goto keep_locked;
+		}
 
 		referenced = page_referenced(page, 1);
 		/* In active use or really unfreeable?  Activate it. */
@@ -567,8 +620,15 @@
 		continue;
 
 activate_locked:
-		SetPageActive(page);
-		pgactivate++;
+		/*
+		 * Do not activate an unmapped page if
+		 * mapped bias is in effect.
+		 */
+		if (!mapped_bias || page_mapped(page)) {
+do_activate_locked:
+			SetPageActive(page);
+			pgactivate++;
+		}
 keep_locked:
 		unlock_page(page);
 keep:
@@ -1200,48 +1260,6 @@
 	LIST_HEAD(l_active);	/* Pages to go onto the active_list */
 	struct page *page;
 	struct pagevec pvec;
-	int reclaim_mapped = 0;
-
-	if (unlikely(sc->may_swap)) {
-		long mapped_ratio;
-		long distress;
-		long swap_tendency;
-
-		/*
-		 * `distress' is a measure of how much trouble we're having
-		 * reclaiming pages.  0 -> no problems.  100 -> great trouble.
-		 */
-		distress = 100 >> zone->prev_priority;
-
-		/*
-		 * The point of this algorithm is to decide when to start
-		 * reclaiming mapped memory instead of just pagecache.  Work out
-		 * how much memory
-		 * is mapped.
-		 */
-		mapped_ratio = (sc->nr_mapped * 100) / total_memory;
-
-		/*
-		 * Now decide how much we really want to unmap some pages.  The
-		 * mapped ratio is downgraded - just because there's a lot of
-		 * mapped memory doesn't necessarily mean that page reclaim
-		 * isn't succeeding.
-		 *
-		 * The distress ratio is important - we don't want to start
-		 * going oom.
-		 *
-		 * A 100% value of vm_swappiness overrides this algorithm
-		 * altogether.
-		 */
-		swap_tendency = mapped_ratio / 2 + distress + vm_swappiness;
-
-		/*
-		 * Now use this metric to decide whether to start moving mapped
-		 * memory onto the inactive list.
-		 */
-		if (swap_tendency >= 100)
-			reclaim_mapped = 1;
-	}
 
 	lru_add_drain();
 	spin_lock_irq(&zone->lru_lock);
@@ -1256,7 +1274,7 @@
 		page = lru_to_page(&l_hold);
 		list_del(&page->lru);
 		if (page_mapped(page)) {
-			if (!reclaim_mapped ||
+			if (!sc->reclaim_mapped ||
 			    (total_swap_pages == 0 && PageAnon(page)) ||
 			    page_referenced(page, 0)) {
 				list_add(&page->lru, &l_active);
@@ -1333,6 +1351,51 @@
 	unsigned long nr_active;
 	unsigned long nr_inactive;
 
+	sc->reclaim_mapped = 0;
+	if (unlikely(sc->may_swap)) {
+		long mapped_ratio;
+		long distress;
+		long swap_tendency;
+
+		/*
+		 * `distress' is a measure of how much trouble we're having
+		 * reclaiming pages.  0 -> no problems.  100 -> great trouble.
+		 *
+		 * When mapped bias is in effect, only apply distress in the
+		 * last pass.
+		 */
+		distress = (sc->pass == 0) ? 100 >> zone->prev_priority : 0;
+
+		/*
+		 * The point of this algorithm is to decide when to start
+		 * reclaiming mapped memory instead of just pagecache.  Work out
+		 * how much memory
+		 * is mapped.
+		 */
+		mapped_ratio = (sc->nr_mapped * 100) / total_memory;
+
+		/*
+		 * Now decide how much we really want to unmap some pages.  The
+		 * mapped ratio is downgraded - just because there's a lot of
+		 * mapped memory doesn't necessarily mean that page reclaim
+		 * isn't succeeding.
+		 *
+		 * The distress ratio is important - we don't want to start
+		 * going oom.
+		 *
+		 * A 100% value of vm_swappiness overrides this algorithm
+		 * altogether.
+		 */
+		swap_tendency = mapped_ratio / 2 + distress + vm_swappiness;
+
+		/*
+		 * Now use this metric to decide whether to start moving mapped
+		 * memory onto the inactive list.
+		 */
+		if (swap_tendency >= 100)
+			sc->reclaim_mapped = 1;
+	}
+
 	atomic_inc(&zone->reclaim_in_progress);
 
 	/*
@@ -1437,10 +1500,14 @@
 	struct scan_control sc;
 	unsigned long lru_pages = 0;
 	int i;
+	int max_priority;
+
+	scanner_start();
 
 	sc.gfp_mask = gfp_mask;
 	sc.may_writepage = !laptop_mode;
 	sc.may_swap = 1;
+	sc.pass = !!mapped_bias;
 
 	inc_page_state(allocstall);
 
@@ -1451,10 +1518,22 @@
 			continue;
 
 		zone->temp_priority = DEF_PRIORITY;
-		lru_pages += zone->nr_active + zone->nr_inactive;
+
+		/*
+		 * When mapped bias is in effect,
+		 * do not count active pages.
+		 */
+		lru_pages += zone->nr_inactive;
+		if (!mapped_bias)
+			lru_pages += zone->nr_active;
 	}
+again:
+	/*
+	 * Only scan down to 0 on the last pass.
+	 */
+	max_priority = (sc.pass == 0) ? 0 : 1;
 
-	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
+	for (priority = DEF_PRIORITY; priority >= max_priority; priority--) {
 		sc.nr_mapped = read_page_state(nr_mapped);
 		sc.nr_scanned = 0;
 		sc.nr_reclaimed = 0;
@@ -1491,6 +1570,8 @@
 		if (sc.nr_scanned && priority < DEF_PRIORITY - 2)
 			blk_congestion_wait(WRITE, HZ/10);
 	}
+	if (--sc.pass >= 0)
+		goto again;
 out:
 	for (i = 0; zones[i] != 0; i++) {
 		struct zone *zone = zones[i];
@@ -1500,6 +1581,7 @@
 
 		zone->prev_priority = zone->temp_priority;
 	}
+	scanner_stop();
 	return ret;
 }
 
@@ -1531,12 +1613,15 @@
 static int balance_pgdat(pg_data_t *pgdat, int nr_pages, int order)
 {
 	int to_free = nr_pages;
-	int all_zones_ok;
+	int all_zones_ok = 1;
 	int priority;
 	int i;
 	int total_scanned, total_reclaimed;
 	struct reclaim_state *reclaim_state = current->reclaim_state;
 	struct scan_control sc;
+	int max_priority;
+
+	scanner_start();
 
 loop_again:
 	total_scanned = 0;
@@ -1545,6 +1630,7 @@
 	sc.may_writepage = !laptop_mode;
 	sc.may_swap = 1;
 	sc.nr_mapped = read_page_state(nr_mapped);
+	sc.pass = (nr_pages == 0) ? !!mapped_bias : 0;
 
 	inc_page_state(pageoutrun);
 
@@ -1553,8 +1639,13 @@
 
 		zone->temp_priority = DEF_PRIORITY;
 	}
-
-	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
+again:
+	/*
+	 * Only scan down to 0 on the last pass.
+	 */
+	max_priority = (sc.pass == 0) ? 0 : 1;
+	
+	for (priority = DEF_PRIORITY; priority >= max_priority; priority--) {
 		int end_zone = 0;	/* Inclusive.  0 = ZONE_DMA */
 		unsigned long lru_pages = 0;
 
@@ -1563,7 +1654,7 @@
 			disable_swap_token();
 
 		all_zones_ok = 1;
-
+	
 		if (nr_pages == 0) {
 			/*
 			 * Scan in the highmem->dma direction for the highest
@@ -1593,7 +1684,13 @@
 		for (i = 0; i <= end_zone; i++) {
 			struct zone *zone = pgdat->node_zones + i;
 
-			lru_pages += zone->nr_active + zone->nr_inactive;
+			/*
+			 * When mapped bias is in effect,
+			 * do not count active pages.
+			 */
+			lru_pages += zone->nr_inactive;
+			if (!mapped_bias)
+				lru_pages += zone->nr_active;
 		}
 
 		/*
@@ -1637,7 +1734,8 @@
 			if (zone->all_unreclaimable)
 				continue;
 			if (nr_slab == 0 && zone->pages_scanned >=
-				    (zone->nr_active + zone->nr_inactive) * 4)
+				    (zone->nr_active + zone->nr_inactive) * 4 *
+					(mapped_bias + 1))
 				zone->all_unreclaimable = 1;
 			/*
 			 * If we've done a decent amount of scanning and
@@ -1651,7 +1749,7 @@
 		if (nr_pages && to_free > total_reclaimed)
 			continue;	/* swsusp: need to do more work */
 		if (all_zones_ok)
-			break;		/* kswapd: all done */
+			goto out;	/* kswapd: all done */
 		/*
 		 * OK, kswapd is getting into trouble.  Take a nap, then take
 		 * another pass across the zones.
@@ -1666,8 +1764,10 @@
 		 * on zone->*_priority.
 		 */
 		if ((total_reclaimed >= SWAP_CLUSTER_MAX) && (!nr_pages))
-			break;
+			goto out;
 	}
+	if (--sc.pass >= 0)
+		goto again;
 out:
 	for (i = 0; i < pgdat->nr_zones; i++) {
 		struct zone *zone = pgdat->node_zones + i;
@@ -1678,6 +1778,7 @@
 		cond_resched();
 		goto loop_again;
 	}
+	scanner_stop();
 
 	return total_reclaimed;
 }
@@ -1898,6 +1999,8 @@
 	if (!cpus_empty(mask) && node_id != numa_node_id())
 		return 0;
 
+	scanner_start();
+
 	sc.may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE);
 	sc.may_swap = !!(zone_reclaim_mode & RECLAIM_SWAP);
 	sc.nr_scanned = 0;
@@ -1905,6 +2008,7 @@
 	sc.priority = ZONE_RECLAIM_PRIORITY + 1;
 	sc.nr_mapped = read_page_state(nr_mapped);
 	sc.gfp_mask = gfp_mask;
+	sc.pass = 0;
 
 	disable_swap_token();
 
@@ -1952,6 +2056,8 @@
 	if (sc.nr_reclaimed == 0)
 		zone->last_unsuccessful_zone_reclaim = jiffies;
 
+	scanner_stop();
+
 	return sc.nr_reclaimed >= nr_pages;
 }
 #endif

^ permalink raw reply

* RE: PAE dom0 is broken with the default config
From: Boris Ostrovsky @ 2006-04-06  1:14 UTC (permalink / raw)
  To: nitin.a.kamble, Keir.Fraser, m+Ian.Pratt; +Cc: xen-devel
In-Reply-To: <E1FRHXg-0001cV-9t@host-192-168-0-1-bcn-london>

>> I built PAE Xen with the default config, and it is not 
>> booting. Log is bellow. If I replace the 
>> linux-defconfig_xen_x86_32 file with the 
>> linux-defconfig_xen0_x86_32 before building then dom0 is able 
>> to boot and see more than 4Gig memory. This looks like a dom0 
>> kernel config issue. Do you care PAE dom0 for 3.0.2 with the 
>> default config? Is anybody working on this?
>
>
> This seems pretty unlikely to be a PAE issue -- we do quite extensive
> testing.
>
> Are you sure you have the right initrd? Is the same scsi driver being
> used as in the -xen0 case?

I suspect there may indeed be some sort of problem with PAE. I have domU RHEL4-U2
SMP 32-bit kernel that dies when it tries to set PAE bit in CR4 --- it
can't find translation for the next instruction (and for anything else, for
that matter: it keeps then getting GPFs on ignore_int's first instruction).

UP version of the same kernel and SMP versions of other kernels, such as 2.6.16,
don't have this problem.

-boris

^ permalink raw reply

* RE: ACPI hotkeys and Panasonic R4
From: Yu, Luming @ 2006-04-06  1:16 UTC (permalink / raw)
  To: David J. Wallace; +Cc: linux-acpi

Please try boot option: acpi_generic_hotkey
Please don't forget apply patchs mentioned at:
http://bugzilla.kernel.org/show_bug.cgi?id=5749#c11

For panasonic , the patch just support :
echo -n xx > /sys/hotkey/brightness .

If you have other question, please feel free to ask. 
 
--Luming

>-----Original Message-----
>From: David J. Wallace [mailto:david@laohu.co.uk] 
>Sent: 2006年4月6日 3:41
>To: Yu, Luming
>Subject: ACPI hotkeys and Panasonic R4
>
>Luming,
>
>I believe that you are the author of the Linux ACPI hotkey 
>driver. I can not 
>get this driver to load on my Panasonic R4. Is this laptop 
>supported? I would 
>appreciate any pointers in getting these going. 
>
>I get the following message when trying to load the module:
>
>FATAL:Error inserting hotkey  (lib/modules....): No such device
>
>I've attached my dmesg and DSDT
>
>I would appreciate any assistance that you could offer.
>
>Thanks,
>
>David
>
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: blame not working well?
From: Junio C Hamano @ 2006-04-06  1:26 UTC (permalink / raw)
  To: Fredrik Kuivinen; +Cc: git
In-Reply-To: <7vacazy33w.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> writes:

> I was having fun updating blame.c to use the built-in xdiff
> instead of spawning and reading from external GNU diff (it is
> currently in "next" branch).  It seems to pass the trivial
> testsuite case but I noticed for example annotating Makefile,
> sha1_name.c, or blame.c in git.git repository seems to show
> quite bogus annotation.  One extreme case is the Makefile; for
> all but one line is blamed for the very initial commit made by
> Linus X-<.  One good news for me is that the version before this
> change has the same breakage.  One bad news is this seems to
> have been broken for some time.
>
> Bisecting indicates 2a0925be3512451834ec9a3e023f4cff23c1cfb7 is
> the first bad commit, but I do not see how the change can break
> it.  I'll continue digging it, but if you have a chance, could
> you take a look, too?

It turns out that the only change needed to revert the breakage
was this one-liner.  get_revision() used to always rewrite
parents when prune and dense are specified, but the updated code
simply skips during the output filtering phase the parents that
would have been culled by calling rewrite_parents() unless the
caller tells it that it is interested in the parent field by
setting rev.parents.

-- >8 --
[PATCH] blame.c: fix completely broken ancestry traversal.

Recent revision.c updates completely broken the assignment of
blames by not rewriting commit->parents field unless explicitly
asked to by the caller.  The caller needs to set revs.parents.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

ba3c93743a8151e3663e1fda6b3cb165d8373ddf
diff --git a/blame.c b/blame.c
index 98f9992..9bb34e6 100644
--- a/blame.c
+++ b/blame.c
@@ -813,6 +813,7 @@ int main(int argc, const char **argv)
 	rev.prune_fn = simplify_commit;
 	rev.topo_setter = topo_setter;
 	rev.topo_getter = topo_getter;
+	rev.parents = 1;
 	rev.limited = 1;
 
 	commit_list_insert(start_commit, &rev.commits);
-- 
1.3.0.rc2.g9cda

^ permalink raw reply related

* Respin: [PATCH] mm: limit lowmem_reserve
From: Con Kolivas @ 2006-04-06  1:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, ck, Nick Piggin, linux-mm
In-Reply-To: <200604061110.35789.kernel@kolivas.org>

Err zone needs to have some pages too sorry.

Respin
---
It is possible with a low enough lowmem_reserve ratio to make
zone_watermark_ok fail repeatedly if the lower_zone is small enough.
Impose a lower limit on the ratio to only allow 1/4 of the lower_zone
size to be set as lowmem_reserve. This limit is hit in ZONE_DMA by changing
the default vmsplit on i386 even without changing the default sysctl values.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

---
 mm/page_alloc.c |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

Index: linux-2.6.17-rc1-mm1/mm/page_alloc.c
===================================================================
--- linux-2.6.17-rc1-mm1.orig/mm/page_alloc.c	2006-04-06 10:32:31.000000000 +1000
+++ linux-2.6.17-rc1-mm1/mm/page_alloc.c	2006-04-06 11:28:11.000000000 +1000
@@ -2566,14 +2566,32 @@ static void setup_per_zone_lowmem_reserv
 			zone->lowmem_reserve[j] = 0;
 
 			for (idx = j-1; idx >= 0; idx--) {
+				unsigned long max_reserve;
+				unsigned long reserve;
 				struct zone *lower_zone;
 
+				lower_zone = pgdat->node_zones + idx;
+				/*
+				 * Put an upper limit on the reserve at 1/4
+				 * the lower_zone size. This prevents large
+				 * zone size differences such as 3G VMSPLIT
+				 * or low sysctl values from making
+				 * zone_watermark_ok always fail. This
+				 * enforces a lower limit on the reserve_ratio
+				 */
+				max_reserve = lower_zone->present_pages / 4;
+
 				if (sysctl_lowmem_reserve_ratio[idx] < 1)
 					sysctl_lowmem_reserve_ratio[idx] = 1;
-
-				lower_zone = pgdat->node_zones + idx;
-				lower_zone->lowmem_reserve[j] = present_pages /
+				reserve = present_pages /
 					sysctl_lowmem_reserve_ratio[idx];
+				if (max_reserve && reserve > max_reserve) {
+					reserve = max_reserve;
+					sysctl_lowmem_reserve_ratio[idx] =
+						present_pages / max_reserve;
+				}
+
+				lower_zone->lowmem_reserve[j] = reserve;
 				present_pages += lower_zone->present_pages;
 			}
 		}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Respin: [PATCH] mm: limit lowmem_reserve
From: Con Kolivas @ 2006-04-06  1:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, ck, Nick Piggin, linux-mm
In-Reply-To: <200604061110.35789.kernel@kolivas.org>

Err zone needs to have some pages too sorry.

Respin
---
It is possible with a low enough lowmem_reserve ratio to make
zone_watermark_ok fail repeatedly if the lower_zone is small enough.
Impose a lower limit on the ratio to only allow 1/4 of the lower_zone
size to be set as lowmem_reserve. This limit is hit in ZONE_DMA by changing
the default vmsplit on i386 even without changing the default sysctl values.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

---
 mm/page_alloc.c |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

Index: linux-2.6.17-rc1-mm1/mm/page_alloc.c
===================================================================
--- linux-2.6.17-rc1-mm1.orig/mm/page_alloc.c	2006-04-06 10:32:31.000000000 +1000
+++ linux-2.6.17-rc1-mm1/mm/page_alloc.c	2006-04-06 11:28:11.000000000 +1000
@@ -2566,14 +2566,32 @@ static void setup_per_zone_lowmem_reserv
 			zone->lowmem_reserve[j] = 0;
 
 			for (idx = j-1; idx >= 0; idx--) {
+				unsigned long max_reserve;
+				unsigned long reserve;
 				struct zone *lower_zone;
 
+				lower_zone = pgdat->node_zones + idx;
+				/*
+				 * Put an upper limit on the reserve at 1/4
+				 * the lower_zone size. This prevents large
+				 * zone size differences such as 3G VMSPLIT
+				 * or low sysctl values from making
+				 * zone_watermark_ok always fail. This
+				 * enforces a lower limit on the reserve_ratio
+				 */
+				max_reserve = lower_zone->present_pages / 4;
+
 				if (sysctl_lowmem_reserve_ratio[idx] < 1)
 					sysctl_lowmem_reserve_ratio[idx] = 1;
-
-				lower_zone = pgdat->node_zones + idx;
-				lower_zone->lowmem_reserve[j] = present_pages /
+				reserve = present_pages /
 					sysctl_lowmem_reserve_ratio[idx];
+				if (max_reserve && reserve > max_reserve) {
+					reserve = max_reserve;
+					sysctl_lowmem_reserve_ratio[idx] =
+						present_pages / max_reserve;
+				}
+
+				lower_zone->lowmem_reserve[j] = reserve;
 				present_pages += lower_zone->present_pages;
 			}
 		}

^ permalink raw reply

* How can found a hiden module ?
From: openbsd shen @ 2006-04-06  1:31 UTC (permalink / raw)
  To: kernel

Use this codes:

int init_module()
{
        if (module.next) module.next = module.next->next;
        ......

I can hide the next module, who can tell me how I can found the hide
module in system?


I think I can check /proc/ksyms against another /proc/ksyms from
truest system, of course, the checked system same as the truest
system, include system version, all loaded modules...

^ permalink raw reply

* What means "\xc7\x44\x24\x18\xda\xff\xff\xff\xe8"
From: openbsd shen @ 2006-04-06  1:38 UTC (permalink / raw)
  To: kernel

this code from get_sct() of suckit 2, why memmem()
"\xc7\x44\x24\x18\xda\xff\xff\xff\xe8"use, what it want to find?
The get_sct() founction:

ulong   get_sct()
{
        uchar   code[SCLEN+256];
        uchar   *p, *pt;
        ulong   r;
        uchar   pt_off, pt_bit;
        int     i;

        kernel_old80 = get_ep();

        if (!kernel_old80)
                return 0;
        if (rkm(code, sizeof(code), kernel_old80-4) <= 0)
                return 0;

        if (!memcmp(code, "PUNK", 4))
                return 0;

        p = (char *) memmem(code, SCLEN, "\xff\x14\x85", 3);
        if (!p) return 0;

        pt = (char *) memmem(p+7, SCLEN-(p-code)-7,
                "\xc7\x44\x24\x18\xda\xff\xff\xff\xe8", 9);
        /* when run at here , it always return 0 */
        if (!pt) {
                eprintf("pt = %s\n", pt);
                return 0;
        }

        sc.trace = *((ulong *) (pt + 9));
        sc.trace += kernel_old80 + (pt - code) - 4 + 9 + 4;

        pt = (char *) memmem(p+7, SCLEN-(p-code)-7, "\xff\x14\x85", 3);
        if (!pt) return 0;

        for (i = 0; i < (p-code); i++) {
                if ((code[i] == 0xf6) && (code[i+1] == 0x43) &&
                    (code[i+4] == 0x75) && (code[i+2] < 127)) {
                        pt_off = code[i+2];
                        pt_bit = code[i+3];
                        goto cc;
                }
        }

        return 0;
}

^ permalink raw reply

* About doc of libnetfilter_queue
From: Frank Abel Cancio Bello @ 2006-04-06  1:38 UTC (permalink / raw)
  To: netfilter

Hi all!

The question is: where I can read libnetfilter_queue documentation?

I have see on Internet some references to "Brad Fisher's documentation of 
libnetfilter_queue", where are this doc?

Salute
Frank Abel


__________________________________________

XIII Convención Científica de Ingeniería y Arquitectura
28/noviembre al 1/diciembre de 2006
Cujae, Ciudad de la Habana, Cuba
http://www.cujae.edu.cu/eventos/convencion


^ permalink raw reply

* about the function register_profile_notifier
From: HuaFeijun @ 2006-04-06  1:41 UTC (permalink / raw)
  To: linux-kernel

who can tell me .which  function has the same function as the
register_profile_notifier function in linux 2.6.12 kernel.Thanks.

^ permalink raw reply

* [ALSA - driver 0001826]: No line, mic, front-mic
From: bugtrack @ 2006-04-06  1:42 UTC (permalink / raw)
  To: alsa-devel


A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1826> 
======================================================================
Reported By:                andreid1303
Assigned To:                tiwai
======================================================================
Project:                    ALSA - driver
Issue ID:                   1826
Category:                   PCI - hda-intel
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Distribution:               
Kernel Version:             
======================================================================
Date Submitted:             02-06-2006 22:35 CET
Last Modified:              04-06-2006 03:42 CEST
======================================================================
Summary:                    No line, mic, front-mic
Description: 
Line, mic, front-mic sound is dead on build-in Sigmatel 9221.
First I was not able to get it in Windows as well but found there a switch
assigning capture input then rised capture level and it is working now.
I tried to do the same via alsamixer but with no result.
======================================================================

----------------------------------------------------------------------
 mate - 04-06-06 03:42 
----------------------------------------------------------------------
I have same problem too (I tried the latest cvs version from 6. Apr.
2006).
Please fix this issue or if somebody have any idea please send me about
it.
Thanx.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
02-06-06 22:35 andreid1303    New Issue                                    
02-07-06 09:23 hweigel        Issue Monitored: hweigel                     
04-06-06 03:42 mate           Note Added: 0009122                          
======================================================================




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.