* Re: [PATCH 03/12] mm: Methods for teaching filesystems about PG_swapcache pages
From: Rik van Riel @ 2012-06-20 15:49 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-4-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> In order to teach filesystems to handle swap cache pages, three new
> page functions are introduced:
>
> pgoff_t page_file_index(struct page *);
> loff_t page_file_offset(struct page *);
> struct address_space *page_file_mapping(struct page *);
>
> page_file_index() - gives the offset of this page in the file in
> PAGE_CACHE_SIZE blocks. Like page->index is for mapped pages, this
> function also gives the correct index for PG_swapcache pages.
>
> page_file_offset() - uses page_file_index(), so that it will give
> the expected result, even for PG_swapcache pages.
>
> page_file_mapping() - gives the mapping backing the actual page;
> that is for swap cache pages it will give swap_file->f_mapping.
>
> Signed-off-by: Peter Zijlstra<a.p.zijlstra@chello.nl>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Reviewed-by: Rik van Riel<riel@redhat.com>
--
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] can: c_can_pci: fix compilation on non HAVE_CLK archs
From: Marc Kleine-Budde @ 2012-06-20 15:58 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-can, Marc Kleine-Budde, Federico Vaga
In commit:
5b92da0 c_can_pci: generic module for C_CAN/D_CAN on PCI
the c_can_pci driver has been added. It uses clk_*() functions
resulting in a link error on archs without clock support. This
patch removed these clk_() functions as these parts of the driver
are not tested.
Cc: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/c_can/c_can_pci.c | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
index 914aecf..1011146 100644
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -13,7 +13,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
-#include <linux/clk.h>
#include <linux/pci.h>
#include <linux/can/dev.h>
@@ -30,7 +29,7 @@ struct c_can_pci_data {
enum c_can_dev_id type;
/* Set the register alignment in the memory */
enum c_can_pci_reg_align reg_align;
- /* Set the frequency if clk is not usable */
+ /* Set the frequency */
unsigned int freq;
};
@@ -71,7 +70,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
struct c_can_priv *priv;
struct net_device *dev;
void __iomem *addr;
- struct clk *clk;
int ret;
ret = pci_enable_device(pdev);
@@ -113,18 +111,11 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
priv->base = addr;
if (!c_can_pci_data->freq) {
- /* get the appropriate clk */
- clk = clk_get(&pdev->dev, NULL);
- if (IS_ERR(clk)) {
- dev_err(&pdev->dev, "no clock defined\n");
- ret = -ENODEV;
- goto out_free_c_can;
- }
- priv->can.clock.freq = clk_get_rate(clk);
- priv->priv = clk;
+ dev_err(&pdev->dev, "no clock frequency defined\n");
+ ret = -ENODEV;
+ goto out_free_c_can;
} else {
priv->can.clock.freq = c_can_pci_data->freq;
- priv->priv = NULL;
}
/* Configure CAN type */
@@ -138,7 +129,7 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break;
default:
ret = -EINVAL;
- goto out_free_clock;
+ goto out_free_c_can;
}
/* Configure access to registers */
@@ -153,14 +144,14 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break;
default:
ret = -EINVAL;
- goto out_free_clock;
+ goto out_free_c_can;
}
ret = register_c_can_dev(dev);
if (ret) {
dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
KBUILD_MODNAME, ret);
- goto out_free_clock;
+ goto out_free_c_can;
}
dev_dbg(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n",
@@ -168,9 +159,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
return 0;
-out_free_clock:
- if (priv->priv)
- clk_put(priv->priv);
out_free_c_can:
pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev);
@@ -193,9 +181,6 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev)
unregister_c_can_dev(dev);
- if (priv->priv)
- clk_put(priv->priv);
-
pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev);
--
1.7.10
^ permalink raw reply related
* Re: [patch net-next 1/2] team: use rcu_access_pointer to access RCU pointer by writer
From: Eric Dumazet @ 2012-06-20 16:01 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, jbrouer, paulmck, wfg
In-Reply-To: <1340206321-5986-2-git-send-email-jpirko@redhat.com>
On Wed, 2012-06-20 at 17:32 +0200, Jiri Pirko wrote:
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> ---
> drivers/net/team/team_mode_activebackup.c | 7 +++++--
> drivers/net/team/team_mode_loadbalance.c | 8 +++++---
> 2 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c
> index 2fe02a8..c9e7621 100644
> --- a/drivers/net/team/team_mode_activebackup.c
> +++ b/drivers/net/team/team_mode_activebackup.c
> @@ -61,8 +61,11 @@ static void ab_port_leave(struct team *team, struct team_port *port)
>
> static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx)
> {
> - if (ab_priv(team)->active_port)
> - ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex;
> + struct team_port *active_port;
> +
> + active_port = rcu_access_pointer(ab_priv(team)->active_port);
This is not the correct fix.
You cant safely dereference active_port if you got it from
rcu_access_pointer()
You should use rcu_dereference() of rcu_dereference_protected() or
rcu_dereference_bh() or similar variant, depending on the context.
> + if (active_port)
> + ctx->data.u32_val = active_port->dev->ifindex;
> else
> ctx->data.u32_val = 0;
> return 0;
> diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
> index 45cc095..b4475a5 100644
> --- a/drivers/net/team/team_mode_loadbalance.c
> +++ b/drivers/net/team/team_mode_loadbalance.c
> @@ -96,7 +96,7 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
> struct lb_port_mapping *pm;
>
> pm = &lb_priv->ex->tx_hash_to_port_mapping[i];
> - if (pm->port == port) {
> + if (rcu_access_pointer(pm->port) == port) {
This one is OK
> rcu_assign_pointer(pm->port, NULL);
I dont understand why you submit two patches...
> team_option_inst_set_change(pm->opt_inst_info);
> changed = true;
> @@ -292,7 +292,7 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
> if (lb_priv->ex->orig_fprog) {
> /* Clear old filter data */
> __fprog_destroy(lb_priv->ex->orig_fprog);
> - sk_unattached_filter_destroy(lb_priv->fp);
> + sk_unattached_filter_destroy(rcu_access_pointer(lb_priv->fp));
> }
^ permalink raw reply
* [PATCH v2] can: c_can_pci: fix compilation on non HAVE_CLK archs
From: Marc Kleine-Budde @ 2012-06-20 16:04 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-can, Marc Kleine-Budde, Federico Vaga
In commit:
5b92da0 c_can_pci: generic module for C_CAN/D_CAN on PCI
the c_can_pci driver has been added. It uses clk_*() functions
resulting in a link error on archs without clock support. This
patch removed these clk_() functions as these parts of the driver
are not tested.
Cc: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Resending with the missing "v2".
Marc
drivers/net/can/c_can/c_can_pci.c | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
index 914aecf..1011146 100644
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -13,7 +13,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
-#include <linux/clk.h>
#include <linux/pci.h>
#include <linux/can/dev.h>
@@ -30,7 +29,7 @@ struct c_can_pci_data {
enum c_can_dev_id type;
/* Set the register alignment in the memory */
enum c_can_pci_reg_align reg_align;
- /* Set the frequency if clk is not usable */
+ /* Set the frequency */
unsigned int freq;
};
@@ -71,7 +70,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
struct c_can_priv *priv;
struct net_device *dev;
void __iomem *addr;
- struct clk *clk;
int ret;
ret = pci_enable_device(pdev);
@@ -113,18 +111,11 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
priv->base = addr;
if (!c_can_pci_data->freq) {
- /* get the appropriate clk */
- clk = clk_get(&pdev->dev, NULL);
- if (IS_ERR(clk)) {
- dev_err(&pdev->dev, "no clock defined\n");
- ret = -ENODEV;
- goto out_free_c_can;
- }
- priv->can.clock.freq = clk_get_rate(clk);
- priv->priv = clk;
+ dev_err(&pdev->dev, "no clock frequency defined\n");
+ ret = -ENODEV;
+ goto out_free_c_can;
} else {
priv->can.clock.freq = c_can_pci_data->freq;
- priv->priv = NULL;
}
/* Configure CAN type */
@@ -138,7 +129,7 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break;
default:
ret = -EINVAL;
- goto out_free_clock;
+ goto out_free_c_can;
}
/* Configure access to registers */
@@ -153,14 +144,14 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break;
default:
ret = -EINVAL;
- goto out_free_clock;
+ goto out_free_c_can;
}
ret = register_c_can_dev(dev);
if (ret) {
dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
KBUILD_MODNAME, ret);
- goto out_free_clock;
+ goto out_free_c_can;
}
dev_dbg(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n",
@@ -168,9 +159,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
return 0;
-out_free_clock:
- if (priv->priv)
- clk_put(priv->priv);
out_free_c_can:
pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev);
@@ -193,9 +181,6 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev)
unregister_c_can_dev(dev);
- if (priv->priv)
- clk_put(priv->priv);
-
pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev);
--
1.7.10
^ permalink raw reply related
* Re: [PATCH 04/12] mm: Add support for a filesystem to activate swap files and use direct_IO for writing swap pages
From: Rik van Riel @ 2012-06-20 16:08 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-5-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> Currently swapfiles are managed entirely by the core VM by using ->bmap
> to allocate space and write to the blocks directly. This effectively
> ensures that the underlying blocks are allocated and avoids the need
> for the swap subsystem to locate what physical blocks store offsets
> within a file.
>
> If the swap subsystem is to use the filesystem information to locate
> the blocks, it is critical that information such as block groups,
> block bitmaps and the block descriptor table that map the swap file
> were resident in memory. This patch adds address_space_operations that
> the VM can call when activating or deactivating swap backed by a file.
>
> int swap_activate(struct file *);
> int swap_deactivate(struct file *);
Acked-by: Rik van Riel<riel@redhat.com>
--
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: [PATCH 05/12] mm: swap: Implement generic handler for swap_activate
From: Rik van Riel @ 2012-06-20 16:09 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-6-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> The version of swap_activate introduced is sufficient for swap-over-NFS
> but would not provide enough information to implement a generic handler.
> This patch shuffles things slightly to ensure the same information is
> available for aops->swap_activate() as is available to the core.
>
> No functionality change.
>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Acked-by: Rik van Riel<riel@redhat.com>
--
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: [PATCH 06/12] mm: Add get_kernel_page[s] for pinning of kernel addresses for I/O
From: Rik van Riel @ 2012-06-20 16:11 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-7-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> This patch adds two new APIs get_kernel_pages() and get_kernel_page()
> that may be used to pin a vector of kernel addresses for IO. The initial
> user is expected to be NFS for allowing pages to be written to swap
> using aops->direct_IO(). Strictly speaking, swap-over-NFS only needs
> to pin one page for IO but it makes sense to express the API in terms
> of a vector and add a helper for pinning single pages.
>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Reviewed-by: Rik van Riel<riel@redhat.com>
--
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: [PATCH v2] ipv4: Early TCP socket demux.
From: Rick Jones @ 2012-06-20 16:21 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, shemminger, netdev
In-Reply-To: <20120619.231401.2278176068934152926.davem@davemloft.net>
On 06/19/2012 11:14 PM, David Miller wrote:
> From: Eric Dumazet<eric.dumazet@gmail.com>
> Date: Wed, 20 Jun 2012 07:51:29 +0200
>
>> On Wed, 2012-06-20 at 07:49 +0200, Eric Dumazet wrote:
>>
>>> 2) small lived tcp sessions
>>>
>>> input dst is now dirtied because of the additional
>>> dst_clone()/dst_release()
>>
>> Not realy a concern because we dirty cache line anyway
>>
>> dst_use_noref()
>> {
>> dst->__use++;
>> dst->lastuse = time;
>> }
>
> Right, the costs probably even out for short TCP flows.
>
> But better to do real tests than to believe what any of
> us say. :-)
netperf -c -C -t TCP_CC ... #just connect/close
or
netperf -c -C -t TCP_CRR ... # with a request/response pair in there
For some definition of "real" anyway :)
rick jones
^ permalink raw reply
* Re: [PATCH] net: Update netdev_alloc_frag to work more efficiently with TCP and GRO
From: Alexander Duyck @ 2012-06-20 16:30 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, davem, jeffrey.t.kirsher
In-Reply-To: <1340170590.4604.784.camel@edumazet-glaptop>
On 06/19/2012 10:36 PM, Eric Dumazet wrote:
> On Tue, 2012-06-19 at 17:43 -0700, Alexander Duyck wrote:
>> This patch is meant to help improve system performance when
>> netdev_alloc_frag is used in scenarios in which buffers are short lived.
>> This is accomplished by allowing the page offset to be reset in the event
>> that the page count is 1. I also reordered the direction in which we give
>> out sections of the page so that we start at the end of the page and end at
>> the start. The main motivation being that I preferred to have offset
>> represent the amount of page remaining to be used.
>>
>> My primary test case was using ixgbe in combination with TCP. With this
>> patch applied I saw CPU utilization drop from 3.4% to 3.0% for a single
>> thread of netperf receiving a TCP stream via ixgbe.
>>
>> I also tested several scenarios in which the page reuse would not be
>> possible such as UDP flows and routing. In both of these scenarios I saw
>> no noticeable performance degradation compared to the kernel without this
>> patch.
>>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
>> ---
>>
>> net/core/skbuff.c | 15 +++++++++++----
>> 1 files changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>> index 5b21522..eb3853c 100644
>> --- a/net/core/skbuff.c
>> +++ b/net/core/skbuff.c
>> @@ -317,15 +317,22 @@ void *netdev_alloc_frag(unsigned int fragsz)
>> if (unlikely(!nc->page)) {
>> refill:
>> nc->page = alloc_page(GFP_ATOMIC | __GFP_COLD);
>> - nc->offset = 0;
>> }
>> if (likely(nc->page)) {
>> - if (nc->offset + fragsz > PAGE_SIZE) {
>> + unsigned int offset = PAGE_SIZE;
>> +
>> + if (page_count(nc->page) != 1)
>> + offset = nc->offset;
>> +
>> + if (offset < fragsz) {
>> put_page(nc->page);
>> goto refill;
>> }
>> - data = page_address(nc->page) + nc->offset;
>> - nc->offset += fragsz;
>> +
>> + offset -= fragsz;
>> + nc->offset = offset;
>> +
>> + data = page_address(nc->page) + offset;
>> get_page(nc->page);
>> }
>> local_irq_restore(flags);
>>
> I tested this idea one month ago and got not convincing results, because
> the branch was taken half of the time.
>
> The cases where page can be reused is probably specific to ixgbe because
> it uses a different allocator for the frags themselves.
> netdev_alloc_frag() is only used to allocate the skb head.
Actually it is pretty much anywhere a copy-break type setup exists. I
think ixgbe and a few other drivers have this type of setup where
netdev_alloc_skb is called and the data is just copied into the buffer.
My thought was if that I can improve this one case without hurting the
other cases I should just go ahead and submit it since it is a net win
performance wise.
I think one of the biggest advantages of this for ixgbe is that it
allows the buffer to become cache warm so that writing the shared info
and copying the header contents becomes very cheap compared to accessing
a cache cold page.
> For typical nics, we allocate frags to populate the RX ring _way_ before
> packet is received by the NIC.
>
> Then, I played with using order-2 pages instead of order-0 ones if
> PAGE_SIZE < 8192.
>
> No clear win either, but you might try this too.
The biggest issue I see with an order-2 page is that it means the memory
is going to take much longer to cycle out of a shared page. As a result
changes like the one I just came up with would likely have little to no
benefit because we would run out of room in the frags list before we
could start reusing a fresh page.
Thanks,
Alex
^ permalink raw reply
* Re: [PATCH 07/12] mm: Add support for direct_IO to highmem pages
From: Rik van Riel @ 2012-06-20 17:08 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-8-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> The patch "mm: Add support for a filesystem to activate swap files and
> use direct_IO for writing swap pages" added support for using direct_IO
> to write swap pages but it is insufficient for highmem pages.
>
> To support highmem pages, this patch kmaps() the page before calling the
> direct_IO() handler. As direct_IO deals with virtual addresses an
> additional helper is necessary for get_kernel_pages() to lookup the
> struct page for a kmap virtual address.
>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Acked-by: Rik van Riel<riel@redhat.com>
--
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
* next-20120620 build error in netfilter
From: Valdis Kletnieks @ 2012-06-20 17:14 UTC (permalink / raw)
To: Pablo Neira Ayuso, netdev; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
Today's linux-next fails to build with CONFIG_NF_NAT_NEEDED=y and CONFIG_NF_NAT=m
LD init/built-in.o
net/built-in.o:(.data+0x4408): undefined reference to `nf_nat_tcp_seq_adjust'
make: *** [vmlinux] Error 1
Breakage introduced with this commit:
commit 8c88f87cb27ad09086940bdd3e6955e5325ec89a
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Thu Jun 7 13:31:25 2012 +0200
netfilter: nfnetlink_queue: add NAT TCP sequence adjustment if packet mangled
[-- Attachment #2: Type: application/pgp-signature, Size: 865 bytes --]
^ permalink raw reply
* Re: [PATCH 08/12] nfs: teach the NFS client how to treat PG_swapcache pages
From: Rik van Riel @ 2012-06-20 17:14 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-9-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> Replace all relevant occurences of page->index and page->mapping in
> the NFS client with the new page_file_index() and page_file_mapping()
> functions.
>
> Signed-off-by: Peter Zijlstra<a.p.zijlstra@chello.nl>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Acked-by: Rik van Riel<riel@redhat.com>
--
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: [PATCH] net: Update netdev_alloc_frag to work more efficiently with TCP and GRO
From: Alexander Duyck @ 2012-06-20 17:14 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, davem, jeffrey.t.kirsher
In-Reply-To: <4FE1FABF.6040309@intel.com>
On 06/20/2012 09:30 AM, Alexander Duyck wrote:
> On 06/19/2012 10:36 PM, Eric Dumazet wrote:
>> On Tue, 2012-06-19 at 17:43 -0700, Alexander Duyck wrote:
>>> This patch is meant to help improve system performance when
>>> netdev_alloc_frag is used in scenarios in which buffers are short lived.
>>> This is accomplished by allowing the page offset to be reset in the event
>>> that the page count is 1. I also reordered the direction in which we give
>>> out sections of the page so that we start at the end of the page and end at
>>> the start. The main motivation being that I preferred to have offset
>>> represent the amount of page remaining to be used.
>>>
>>> My primary test case was using ixgbe in combination with TCP. With this
>>> patch applied I saw CPU utilization drop from 3.4% to 3.0% for a single
>>> thread of netperf receiving a TCP stream via ixgbe.
>>>
>>> I also tested several scenarios in which the page reuse would not be
>>> possible such as UDP flows and routing. In both of these scenarios I saw
>>> no noticeable performance degradation compared to the kernel without this
>>> patch.
>>>
>>> Cc: Eric Dumazet <edumazet@google.com>
>>> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
>>> ---
>>>
>>> net/core/skbuff.c | 15 +++++++++++----
>>> 1 files changed, 11 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>>> index 5b21522..eb3853c 100644
>>> --- a/net/core/skbuff.c
>>> +++ b/net/core/skbuff.c
>>> @@ -317,15 +317,22 @@ void *netdev_alloc_frag(unsigned int fragsz)
>>> if (unlikely(!nc->page)) {
>>> refill:
>>> nc->page = alloc_page(GFP_ATOMIC | __GFP_COLD);
>>> - nc->offset = 0;
>>> }
>>> if (likely(nc->page)) {
>>> - if (nc->offset + fragsz > PAGE_SIZE) {
>>> + unsigned int offset = PAGE_SIZE;
>>> +
>>> + if (page_count(nc->page) != 1)
>>> + offset = nc->offset;
>>> +
>>> + if (offset < fragsz) {
>>> put_page(nc->page);
>>> goto refill;
>>> }
>>> - data = page_address(nc->page) + nc->offset;
>>> - nc->offset += fragsz;
>>> +
>>> + offset -= fragsz;
>>> + nc->offset = offset;
>>> +
>>> + data = page_address(nc->page) + offset;
>>> get_page(nc->page);
>>> }
>>> local_irq_restore(flags);
>>>
>> I tested this idea one month ago and got not convincing results, because
>> the branch was taken half of the time.
>>
>> The cases where page can be reused is probably specific to ixgbe because
>> it uses a different allocator for the frags themselves.
>> netdev_alloc_frag() is only used to allocate the skb head.
> Actually it is pretty much anywhere a copy-break type setup exists. I
> think ixgbe and a few other drivers have this type of setup where
> netdev_alloc_skb is called and the data is just copied into the buffer.
> My thought was if that I can improve this one case without hurting the
> other cases I should just go ahead and submit it since it is a net win
> performance wise.
>
> I think one of the biggest advantages of this for ixgbe is that it
> allows the buffer to become cache warm so that writing the shared info
> and copying the header contents becomes very cheap compared to accessing
> a cache cold page.
>
>> For typical nics, we allocate frags to populate the RX ring _way_ before
>> packet is received by the NIC.
>>
>> Then, I played with using order-2 pages instead of order-0 ones if
>> PAGE_SIZE < 8192.
>>
>> No clear win either, but you might try this too.
> The biggest issue I see with an order-2 page is that it means the memory
> is going to take much longer to cycle out of a shared page. As a result
> changes like the one I just came up with would likely have little to no
> benefit because we would run out of room in the frags list before we
> could start reusing a fresh page.
>
> Thanks,
>
> Alex
>
Actually I think I just realized what the difference is. I was looking
at things with LRO disabled. With LRO enabled our hardware RSC feature
kind of defeats the whole point of the GRO or TCP coalescing anyway
since it will stuff 16 fragments into a single packet before we even
hand the packet off to the stack.
Thanks,
Alex
^ permalink raw reply
* Re: [PATCH 09/12] nfs: disable data cache revalidation for swapfiles
From: Rik van Riel @ 2012-06-20 17:16 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-10-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> The VM does not like PG_private set on PG_swapcache pages. As suggested
> by Trond in http://lkml.org/lkml/2006/8/25/348, this patch disables
> NFS data cache revalidation on swap files. as it does not make
> sense to have other clients change the file while it is being used as
> swap. This avoids setting PG_private on swap pages, since there ought
> to be no further races with invalidate_inode_pages2() to deal with.
>
> Since we cannot set PG_private we cannot use page->private which
> is already used by PG_swapcache pages to store the nfs_page. Thus
> augment the new nfs_page_find_request logic.
>
> Signed-off-by: Peter Zijlstra<a.p.zijlstra@chello.nl>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Acked-by: Rik van Riel<riel@redhat.com>
--
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
* [ndisc6] Bad NIC causing IPV6 NDP to stop working
From: Menny_Hamburger @ 2012-06-20 17:09 UTC (permalink / raw)
To: netdev
Hi,
We have witnessed several cases where we suspect that a bad NIC on the machine caused neighbour discovery to stop working on all the other NICs - when this happens ping6 fails on every NIC we try it.
>From looking into the code I see that there is only a single socket assigned for NDP; Does it sound logical to allocate a socket per interface instead of a single global socket.
Thanks,
Menny
^ permalink raw reply
* Q: NET/JME: pci_get_drvdata pointer return check at jme_remove
From: devendra.aaru @ 2012-06-20 17:20 UTC (permalink / raw)
To: netdev
Hi,
looking at the jme_init_one error path, the context of the driver data
is set to null.
If the driver unloads , the unload _remove_one, will be called and
deferencing the pointer, leading to a oops.
so we need to have a check at before doing the netdev_priv at remove_one.
Please correct me if my understanding is wrong....
Thanks,
Devendra.
^ permalink raw reply
* Re: [net-next.git 4/4 (v7)] phy: add the EEE support and the way to access to the MMD registers.
From: Ben Hutchings @ 2012-06-20 17:22 UTC (permalink / raw)
To: Giuseppe CAVALLARO; +Cc: netdev, eric.dumazet, rayagond, davem, yuvalmin
In-Reply-To: <1340172774-27443-5-git-send-email-peppe.cavallaro@st.com>
On Wed, 2012-06-20 at 08:12 +0200, Giuseppe CAVALLARO wrote:
[...]
> +int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable)
> +{
> + int ret = -EPROTONOSUPPORT;
> +
> + /* According to 802.3az,the EEE is supported only in full duplex-mode.
> + * Also EEE feature is active when core is operating with MII, GMII
> + * or RGMII.
> + */
> + if ((phydev->duplex == DUPLEX_FULL) &&
> + ((phydev->interface == PHY_INTERFACE_MODE_MII) ||
> + (phydev->interface == PHY_INTERFACE_MODE_GMII) ||
> + (phydev->interface == PHY_INTERFACE_MODE_RGMII))) {
> + u16 eee_lp, eee_cap, eee_adv;
> + u32 lp, cap, adv;
> + int idx;
> +
> + /* Read phy status to properly get the right settings */
> + ret = phy_read_status(phydev);
> + if (ret)
> + return ret;
> +
> + /* First check if the EEE ability is supported */
> + eee_cap = phy_read_mmd_indirect(phydev->bus, MDIO_PCS_EEE_ABLE,
> + MDIO_MMD_PCS, phydev->addr);
> + if (eee_cap < 0)
> + return eee_cap;
> +
> + cap = phy_eee_to_supported(eee_cap);
> + if (!cap)
> + goto eee_exit;
But this now means returning 0 since you added the call to
phy_read_status() above. Maybe you should just return -EPROTONOSUPPORT
directly instead of relying on the assumed value of ret?
> + /* Check which link settings negotiated and verify it in
> + * the EEE advertising registers.
> + */
> + eee_lp = phy_read_mmd_indirect(phydev->bus, MDIO_AN_EEE_LPABLE,
> + MDIO_MMD_AN, phydev->addr);
> + if (eee_lp < 0)
> + return eee_lp;
> +
> + eee_adv = phy_read_mmd_indirect(phydev->bus, MDIO_AN_EEE_ADV,
> + MDIO_MMD_AN, phydev->addr);
> + if (eee_adv < 0)
> + return eee_adv;
> +
> + adv = phy_eee_to_adv(eee_adv);
> + lp = phy_eee_to_adv(eee_lp);
> + idx = phy_find_setting(phydev->speed, phydev->duplex);
> + if ((lp & adv & settings[idx].setting))
> + goto eee_exit;
[...]
Same problem here.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: next-20120620 build error in netfilter
From: Pablo Neira Ayuso @ 2012-06-20 17:28 UTC (permalink / raw)
To: Valdis Kletnieks; +Cc: netdev, linux-kernel
In-Reply-To: <32596.1340212473@turing-police.cc.vt.edu>
On Wed, Jun 20, 2012 at 01:14:33PM -0400, Valdis Kletnieks wrote:
> Today's linux-next fails to build with CONFIG_NF_NAT_NEEDED=y and CONFIG_NF_NAT=m
>
> LD init/built-in.o
> net/built-in.o:(.data+0x4408): undefined reference to `nf_nat_tcp_seq_adjust'
> make: *** [vmlinux] Error 1
I guess you have NF_CT_NETLINK=y, right?
> Breakage introduced with this commit:
>
> commit 8c88f87cb27ad09086940bdd3e6955e5325ec89a
> Author: Pablo Neira Ayuso <pablo@netfilter.org>
> Date: Thu Jun 7 13:31:25 2012 +0200
>
> netfilter: nfnetlink_queue: add NAT TCP sequence adjustment if packet mangled
>
^ permalink raw reply
* Re: [PATCH 10/12] nfs: enable swap on NFS
From: Rik van Riel @ 2012-06-20 17:38 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-11-git-send-email-mgorman@suse.de>
On 06/20/2012 05:37 AM, Mel Gorman wrote:
> Implement the new swapfile a_ops for NFS and hook up ->direct_IO. This
> will set the NFS socket to SOCK_MEMALLOC and run socket reconnect
> under PF_MEMALLOC as well as reset SOCK_MEMALLOC before engaging the
> protocol ->connect() method.
>
> PF_MEMALLOC should allow the allocation of struct socket and related
> objects and the early (re)setting of SOCK_MEMALLOC should allow us
> to receive the packets required for the TCP connection buildup.
>
> [dfeng@redhat.com: Fix handling of multiple swap files]
> [a.p.zijlstra@chello.nl: Original patch]
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Acked-by: Rik van Riel<riel@redhat.com>
--
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: [PATCH 11/12] nfs: Prevent page allocator recursions with swap over NFS.
From: Rik van Riel @ 2012-06-20 17:42 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-12-git-send-email-mgorman@suse.de>
On 06/20/2012 05:38 AM, Mel Gorman wrote:
> GFP_NOFS is _more_ permissive than GFP_NOIO in that it will initiate
> IO, just not of any filesystem data.
>
> The problem is that previously NOFS was correct because that avoids
> recursion into the NFS code. With swap-over-NFS, it is no longer
> correct as swap IO can lead to this recursion.
>
> Signed-off-by: Peter Zijlstra<a.p.zijlstra@chello.nl>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Acked-by: Rik van Riel<riel@redhat.com>
--
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: [PATCH 12/12] Avoid dereferencing bd_disk during swap_entry_free for network storage
From: Rik van Riel @ 2012-06-20 17:47 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1340185081-22525-13-git-send-email-mgorman@suse.de>
On 06/20/2012 05:38 AM, Mel Gorman wrote:
> Commit [b3a27d: swap: Add swap slot free callback to
> block_device_operations] dereferences p->bdev->bd_disk but this is a
> NULL dereference if using swap-over-NFS. This patch checks SWP_BLKDEV
> on the swap_info_struct before dereferencing.
>
> With reference to this callback, Christoph Hellwig stated "Please
> just remove the callback entirely. It has no user outside the staging
> tree and was added clearly against the rules for that staging tree".
> This would also be my preference but there was not an obvious way of
> keeping zram in staging/ happy.
>
> Signed-off-by: Xiaotian Feng<dfeng@redhat.com>
> Signed-off-by: Mel Gorman<mgorman@suse.de>
Acked-by: Rik van Riel<riel@redhat.com>
--
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: [PATCH net-next 2/6] bnx2x: link cleanup
From: Yuval Mintz @ 2012-06-20 17:50 UTC (permalink / raw)
To: Joe Perches
Cc: davem@davemloft.net, netdev@vger.kernel.org, Eilon Greenstein,
Yaniv Rosner
In-Reply-To: <1340204019.29885.9.camel@joe2Laptop>
> > 3. Change msleep(1) --> usleep_range(1000, 1000)
>
> I believe replacing msleep(small) with
> usleep_range(small * 1000, small * 1000) is
> not generally a good idea.
>
> Please give usleep_range an actual range to
> work with and not a repeated single value.
>
> Please think a little more about what a
> good upper range for the maximum time to
> sleep should be.
>
> usleep_range(small * 1000, small * 2000)
> or something similar maybe.
>
Sounds good. I'll change it and re-send the patch series.
Thanks,
Yuval Mintz
^ permalink raw reply
* Re: [PATCH v2] ipv4: Early TCP socket demux.
From: Ben Hutchings @ 2012-06-20 18:07 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, shemminger, netdev
In-Reply-To: <1340171940.4604.799.camel@edumazet-glaptop>
On Wed, 2012-06-20 at 07:59 +0200, Eric Dumazet wrote:
> On Tue, 2012-06-19 at 21:46 -0700, David Miller wrote:
>
> > These numbers can be decreased further, because since we're already
> > looking at the TCP header we can pre-cook the TCP control block in the
> > SKB and skip much of the stuff that tcp_v4_rcv() does since we've done
> > it already in the early demux code.
>
> It could be done at GRO level and remove one another demux.
>
> As routers probably have no use of GRO, no need of additional knob.
I don't know what you mean by 'have no use'. It's enabled anyway, and I
would expect that it's beneficial for some smaller routers.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH v2] ipv4: Early TCP socket demux.
From: Ben Hutchings @ 2012-06-20 18:16 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20120619.190202.2133868658770269780.davem@davemloft.net>
On Tue, 2012-06-19 at 19:02 -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Tue, 19 Jun 2012 18:05:27 -0700 (PDT)
>
> > From: Ben Hutchings <bhutchings@solarflare.com>
> > Date: Wed, 20 Jun 2012 02:03:26 +0100
> >
> >> On Tue, 2012-06-19 at 17:54 -0700, David Miller wrote:
> >>> The hash is perfect, what's the big deal?
> >>
> >> It obscures what we're really doing and relying on.
> >
> > If it matters to you, patches are always welcome :-)
>
> Nevermind, I just committed the following to net-next:
[...]
Thanks very much, David.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [patch net-next 1/2] team: use rcu_access_pointer to access RCU pointer by writer
From: Jiri Pirko @ 2012-06-20 18:33 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, davem, jbrouer, paulmck, wfg
In-Reply-To: <1340208104.4604.1247.camel@edumazet-glaptop>
Wed, Jun 20, 2012 at 06:01:44PM CEST, eric.dumazet@gmail.com wrote:
>On Wed, 2012-06-20 at 17:32 +0200, Jiri Pirko wrote:
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> ---
>> drivers/net/team/team_mode_activebackup.c | 7 +++++--
>> drivers/net/team/team_mode_loadbalance.c | 8 +++++---
>> 2 files changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c
>> index 2fe02a8..c9e7621 100644
>> --- a/drivers/net/team/team_mode_activebackup.c
>> +++ b/drivers/net/team/team_mode_activebackup.c
>> @@ -61,8 +61,11 @@ static void ab_port_leave(struct team *team, struct team_port *port)
>>
>> static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx)
>> {
>> - if (ab_priv(team)->active_port)
>> - ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex;
>> + struct team_port *active_port;
>> +
>> + active_port = rcu_access_pointer(ab_priv(team)->active_port);
>
>This is not the correct fix.
>
>You cant safely dereference active_port if you got it from
>rcu_access_pointer()
>
>You should use rcu_dereference() of rcu_dereference_protected() or
>rcu_dereference_bh() or similar variant, depending on the context.
Okay, reworking this using rcu_dereference_protected() since this is
update path.
>
>> + if (active_port)
>> + ctx->data.u32_val = active_port->dev->ifindex;
>> else
>> ctx->data.u32_val = 0;
>> return 0;
>> diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
>> index 45cc095..b4475a5 100644
>> --- a/drivers/net/team/team_mode_loadbalance.c
>> +++ b/drivers/net/team/team_mode_loadbalance.c
>> @@ -96,7 +96,7 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
>> struct lb_port_mapping *pm;
>>
>> pm = &lb_priv->ex->tx_hash_to_port_mapping[i];
>> - if (pm->port == port) {
>> + if (rcu_access_pointer(pm->port) == port) {
>
>This one is OK
>
>> rcu_assign_pointer(pm->port, NULL);
>
>I dont understand why you submit two patches...
Squashing into one now.
>
>> team_option_inst_set_change(pm->opt_inst_info);
>> changed = true;
>> @@ -292,7 +292,7 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
>> if (lb_priv->ex->orig_fprog) {
>> /* Clear old filter data */
>> __fprog_destroy(lb_priv->ex->orig_fprog);
>> - sk_unattached_filter_destroy(lb_priv->fp);
>> + sk_unattached_filter_destroy(rcu_access_pointer(lb_priv->fp));
>> }
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox