All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 05/12] NFS: ask for layouttypes during v4 fsinfo call
From: Fred Isaman @ 2010-10-20  4:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust
In-Reply-To: <1287548284-28374-1-git-send-email-iisaman@netapp.com>

From: Andy Adamson <andros@netapp.com>

This information will be used to determine which layout driver,
if any, to use for subsequent IO on this filesystem.  Each driver
is assigned an integer id, with 0 reserved to indicate no driver.

The server can in theory return multiple ids.  However, our current
client implementation only notes the first entry and ignores the
rest.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4proc.c       |    2 +-
 fs/nfs/nfs4xdr.c        |   57 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/nfs_xdr.h |    1 +
 3 files changed, 59 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 88a9d93..52a486b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -129,7 +129,7 @@ const u32 nfs4_fsinfo_bitmap[2] = { FATTR4_WORD0_MAXFILESIZE
 			| FATTR4_WORD0_MAXREAD
 			| FATTR4_WORD0_MAXWRITE
 			| FATTR4_WORD0_LEASE_TIME,
-			0
+			FATTR4_WORD1_FS_LAYOUT_TYPES
 };
 
 const u32 nfs4_fs_locations_bitmap[2] = {
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 6ea5c93..28c2475 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3868,6 +3868,60 @@ xdr_error:
 	return status;
 }
 
+/*
+ * Decode potentially multiple layout types. Currently we only support
+ * one layout driver per file system.
+ */
+static int decode_first_pnfs_layout_type(struct xdr_stream *xdr,
+					 uint32_t *layouttype)
+{
+	uint32_t *p;
+	int num;
+
+	p = xdr_inline_decode(xdr, 4);
+	if (unlikely(!p))
+		goto out_overflow;
+	num = be32_to_cpup(p);
+
+	/* pNFS is not supported by the underlying file system */
+	if (num == 0) {
+		*layouttype = 0;
+		return 0;
+	}
+	if (num > 1)
+		printk(KERN_INFO "%s: Warning: Multiple pNFS layout drivers "
+			"per filesystem not supported\n", __func__);
+
+	/* Decode and set first layout type, move xdr->p past unused types */
+	p = xdr_inline_decode(xdr, num * 4);
+	if (unlikely(!p))
+		goto out_overflow;
+	*layouttype = be32_to_cpup(p);
+	return 0;
+out_overflow:
+	print_overflow_msg(__func__, xdr);
+	return -EIO;
+}
+
+/*
+ * The type of file system exported.
+ * Note we must ensure that layouttype is set in any non-error case.
+ */
+static int decode_attr_pnfstype(struct xdr_stream *xdr, uint32_t *bitmap,
+				uint32_t *layouttype)
+{
+	int status = 0;
+
+	dprintk("%s: bitmap is %x\n", __func__, bitmap[1]);
+	if (unlikely(bitmap[1] & (FATTR4_WORD1_FS_LAYOUT_TYPES - 1U)))
+		return -EIO;
+	if (bitmap[1] & FATTR4_WORD1_FS_LAYOUT_TYPES) {
+		status = decode_first_pnfs_layout_type(xdr, layouttype);
+		bitmap[1] &= ~FATTR4_WORD1_FS_LAYOUT_TYPES;
+	} else
+		*layouttype = 0;
+	return status;
+}
 
 static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
 {
@@ -3894,6 +3948,9 @@ static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
 	if ((status = decode_attr_maxwrite(xdr, bitmap, &fsinfo->wtmax)) != 0)
 		goto xdr_error;
 	fsinfo->wtpref = fsinfo->wtmax;
+	status = decode_attr_pnfstype(xdr, bitmap, &fsinfo->layouttype);
+	if (status)
+		goto xdr_error;
 
 	status = verify_attr_len(xdr, savep, attrlen);
 xdr_error:
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5772b2c..d89920c 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -113,6 +113,7 @@ struct nfs_fsinfo {
 	__u32			dtpref;	/* pref. readdir transfer size */
 	__u64			maxfilesize;
 	__u32			lease_time; /* in seconds */
+	__u32			layouttype; /* supported pnfs layout driver */
 };
 
 struct nfs_fsstat {
-- 
1.7.2.1


^ permalink raw reply related

* [PATCH 04/12] NFS: change stateid to be a union
From: Fred Isaman @ 2010-10-20  4:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust
In-Reply-To: <1287548284-28374-1-git-send-email-iisaman@netapp.com>

From: Alexandros Batsakis <batsakis@netapp.com>

In NFSv4.1 the stateid consists of the other and seqid fields. For layout
processing we need to numerically compare the seqid value of layout stateids.
To do so, introduce a union to nfs4_stateid to switch between opaque(16 bytes)
and opaque(12 bytes) / __be32

Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/callback_proc.c |    8 ++++----
 include/linux/nfs4.h   |   15 +++++++++++++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 930d10f..2950fca 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -118,11 +118,11 @@ int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const n
 	if (delegation == NULL)
 		return 0;
 
-	/* seqid is 4-bytes long */
-	if (((u32 *) &stateid->data)[0] != 0)
+	if (stateid->stateid.seqid != 0)
 		return 0;
-	if (memcmp(&delegation->stateid.data[4], &stateid->data[4],
-		   sizeof(stateid->data)-4))
+	if (memcmp(&delegation->stateid.stateid.other,
+		   &stateid->stateid.other,
+		   NFS4_STATEID_OTHER_SIZE))
 		return 0;
 
 	return 1;
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 6c0406e..34da324 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -17,7 +17,9 @@
 
 #define NFS4_BITMAP_SIZE	2
 #define NFS4_VERIFIER_SIZE	8
-#define NFS4_STATEID_SIZE	16
+#define NFS4_STATEID_SEQID_SIZE 4
+#define NFS4_STATEID_OTHER_SIZE 12
+#define NFS4_STATEID_SIZE	(NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
 #define NFS4_FHSIZE		128
 #define NFS4_MAXPATHLEN		PATH_MAX
 #define NFS4_MAXNAMLEN		NAME_MAX
@@ -167,7 +169,16 @@ struct nfs4_acl {
 };
 
 typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
-typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid;
+
+struct nfs41_stateid {
+	__be32 seqid;
+	char other[NFS4_STATEID_OTHER_SIZE];
+} __attribute__ ((packed));
+
+typedef union {
+	char data[NFS4_STATEID_SIZE];
+	struct nfs41_stateid stateid;
+} nfs4_stateid;
 
 enum nfs_opnum4 {
 	OP_ACCESS = 3,
-- 
1.7.2.1


^ permalink raw reply related

* [PATCH 02/12] SUNRPC: define xdr_decode_opaque_fixed
From: Fred Isaman @ 2010-10-20  4:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust
In-Reply-To: <1287548284-28374-1-git-send-email-iisaman@netapp.com>

From: Benny Halevy <bhalevy@panasas.com>

A helper for decoding a fixed length opaque value.
Returns a pointer to the next item in the xdr stream.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 include/linux/sunrpc/xdr.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 8c1dcbb..f104f90 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -132,6 +132,13 @@ xdr_decode_hyper(__be32 *p, __u64 *valp)
 	return p + 2;
 }
 
+static inline __be32 *
+xdr_decode_opaque_fixed(__be32 *p, void *ptr, unsigned int len)
+{
+	memcpy(ptr, p, len);
+	return p + XDR_QUADLEN(len);
+}
+
 /*
  * Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
  */
-- 
1.7.2.1


^ permalink raw reply related

* [PATCH 03/12] NFSv4.1: pnfsd, pnfs: protocol level pnfs constants
From: Fred Isaman @ 2010-10-20  4:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust
In-Reply-To: <1287548284-28374-1-git-send-email-iisaman@netapp.com>

From: Dean Hildebrand <dhildebz@umich.edu>

Use only layoutreturn constant for both returns and recalls.
(return_* works better for recall_type rather the other way around)

Signed-off-by: Dean Hildebrand <dhildebz@umich.edu>
Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 include/linux/nfs4.h |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 07e40c6..6c0406e 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -471,6 +471,8 @@ enum lock_type4 {
 #define FATTR4_WORD1_TIME_MODIFY        (1UL << 21)
 #define FATTR4_WORD1_TIME_MODIFY_SET    (1UL << 22)
 #define FATTR4_WORD1_MOUNTED_ON_FILEID  (1UL << 23)
+#define FATTR4_WORD1_FS_LAYOUT_TYPES    (1UL << 30)
+#define FATTR4_WORD2_LAYOUT_BLKSIZE     (1UL << 1)
 
 #define NFSPROC4_NULL 0
 #define NFSPROC4_COMPOUND 1
@@ -550,6 +552,49 @@ enum state_protect_how4 {
 	SP4_SSV		= 2
 };
 
+enum pnfs_layouttype {
+	LAYOUT_NFSV4_1_FILES  = 1,
+	LAYOUT_OSD2_OBJECTS = 2,
+	LAYOUT_BLOCK_VOLUME = 3,
+};
+
+/* used for both layout return and recall */
+enum pnfs_layoutreturn_type {
+	RETURN_FILE = 1,
+	RETURN_FSID = 2,
+	RETURN_ALL  = 3
+};
+
+enum pnfs_iomode {
+	IOMODE_READ = 1,
+	IOMODE_RW = 2,
+	IOMODE_ANY = 3,
+};
+
+enum pnfs_notify_deviceid_type4 {
+	NOTIFY_DEVICEID4_CHANGE = 1 << 1,
+	NOTIFY_DEVICEID4_DELETE = 1 << 2,
+};
+
+#define NFL4_UFLG_MASK			0x0000003F
+#define NFL4_UFLG_DENSE			0x00000001
+#define NFL4_UFLG_COMMIT_THRU_MDS	0x00000002
+#define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK	0xFFFFFFC0
+
+/* Encoded in the loh_body field of type layouthint4 */
+enum filelayout_hint_care4 {
+	NFLH4_CARE_DENSE		= NFL4_UFLG_DENSE,
+	NFLH4_CARE_COMMIT_THRU_MDS	= NFL4_UFLG_COMMIT_THRU_MDS,
+	NFLH4_CARE_STRIPE_UNIT_SIZE	= 0x00000040,
+	NFLH4_CARE_STRIPE_COUNT		= 0x00000080
+};
+
+#define NFS4_DEVICEID4_SIZE 16
+
+struct nfs4_deviceid {
+	char data[NFS4_DEVICEID4_SIZE];
+};
+
 #endif
 #endif
 
-- 
1.7.2.1


^ permalink raw reply related

* [PATCH 01/12] NFSD: remove duplicate NFS4_STATEID_SIZE
From: Fred Isaman @ 2010-10-20  4:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust
In-Reply-To: <1287548284-28374-1-git-send-email-iisaman@netapp.com>

From: Andy Adamson <andros@netapp.com>

Already accepted by Bruce

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfsd/nfs4callback.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 988cbb3..014482c 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -41,7 +41,6 @@
 
 #define NFSPROC4_CB_NULL 0
 #define NFSPROC4_CB_COMPOUND 1
-#define NFS4_STATEID_SIZE 16
 
 /* Index of predefined Linux callback client operations */
 
-- 
1.7.2.1


^ permalink raw reply related

* [PATCH 00/12] pnfs: LAYOUTGET/DEVINFO submission v5
From: Fred Isaman @ 2010-10-20  4:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust

This is try 5 of the first wave of the linux pnfs client submission.
The only change (besides rebase on top of Trond's most recent
nfs-for-2.6.37 branch) between this series and the previous is that
owner/sign-off issues have been addressed, which allows us to
remove the RFC label of the previous series.

For those interested, the patches themselves can also be found at
git://linux-nfs.org/~iisaman/linux-pnfs.git,
branch devinfo-submit-rc7-trond


This is the start of code implementing pnfs, based on RFC 5661.  Since
sending the whole thing at once would be overwhelming, we are trying
to break it into bite sized waves.  This first wave implements the
mount/umount infrastructure, as well as sending the LAYOUTGET and
GETDEVTICEINFO calls on io (but not actually using the information for
io).  Note that two major simplifications to the protocol will be made 
throughout the initial submission process:  only the file layout
driver is considered, and only whole file layouts are requested.


These patches apply against Trond's nfs-for-2.6.37 branch.

patches 01-08 implement the mount/umount hooks
patches 09-12 implement LAYOUTGET and GETDEVICEINFO


^ permalink raw reply

* Re: [PATCH][memcg+dirtylimit] Fix  overwriting global vm dirty limit setting by memcg (Re: [PATCH v3 00/11] memcg: per cgroup dirty page accounting
From: KAMEZAWA Hiroyuki @ 2010-10-20  4:14 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: Greg Thelen, Andrew Morton, linux-kernel, linux-mm, containers,
	Andrea Righi, Balbir Singh, Daisuke Nishimura, Minchan Kim,
	Ciju Rajan K, David Rientjes
In-Reply-To: <20101020122144.47f2b60b.kamezawa.hiroyu@jp.fujitsu.com>

On Wed, 20 Oct 2010 12:21:44 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> 
> One bug fix here.
> ==
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> 
> Now, at calculating dirty limit, vm_dirty_param() is called.
> This function returns dirty-limit related parameters considering
> memory cgroup settings.
> 
> Now, assume that vm_dirty_bytes=100M (global dirty limit) and
> memory cgroup has 1G of pages and 40 dirty_ratio, dirtyable memory is
> 500MB.
> 
> In this case, global_dirty_limits will consider dirty_limt as
> 500 *0.4 = 200MB. This is bad...memory cgroup is not back door.
> 
> This patch limits the return value of vm_dirty_param() considring
> global settings.
> 
> 

Sorry, this one is buggy. I'll post a new one later.

Thanks,
-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: [PATCH] sched_rt: Removes extra checking for nr_cpus_allowed when calling find_lowest_rq
From: Rakib Mullick @ 2010-10-20  4:13 UTC (permalink / raw)
  To: Gregory Haskins; +Cc: Peter Zijlstra, Ingo Molnar, Steven Rostedt, LKML
In-Reply-To: <AANLkTi=-E6f3US+h9vzmZhQbzLkaoA4_OZqu8uV3wsjv@mail.gmail.com>

On Tue, Oct 19, 2010 at 8:40 PM, Rakib Mullick <rakib.mullick@gmail.com> wrote:
> On 10/19/10, Gregory Haskins <ghaskins@novell.com> wrote:
>>>>> On 10/19/2010 at 07:02 AM, in message <1287486167.1994.1.camel@twins>,
>>>>> Peter
>> Zijlstra <peterz@infradead.org> wrote:
>>> On Tue, 2010-10-19 at 16:57 +0600, Rakib Mullick wrote:
>>
> If we made explicit check before calling find_lowest_rq, then I don't
> think we need the change that Steve's suggesting. I think explicitly
> checking is much more easier and removes extra overhead of function
> calling.

The following patch shows what I was trying to say. Please check and
comment. Hopefully this looks clean.


--- linus-rc8/kernel/sched_rt.c	2010-10-19 16:42:05.000000000 +0600
+++ rakib-rc8/kernel/sched_rt.c	2010-10-20 10:04:08.000000000 +0600
@@ -1174,9 +1174,6 @@ static int find_lowest_rq(struct task_st
 	int this_cpu = smp_processor_id();
 	int cpu      = task_cpu(task);

-	if (task->rt.nr_cpus_allowed == 1)
-		return -1; /* No other targets possible */
-
 	if (!cpupri_find(&task_rq(task)->rd->cpupri, task, lowest_mask))
 		return -1; /* No targets found */

@@ -1238,6 +1235,9 @@ static struct rq *find_lock_lowest_rq(st
 	int tries;
 	int cpu;

+	if (task->rt.nr_cpus_allowed < 2)
+		goto out;
+
 	for (tries = 0; tries < RT_MAX_TRIES; tries++) {
 		cpu = find_lowest_rq(task);

@@ -1275,6 +1275,7 @@ static struct rq *find_lock_lowest_rq(st
 		lowest_rq = NULL;
 	}

+out:
 	return lowest_rq;
 }



Thanks,
Rakib

>
> Thanks,
> Rakib
>> Kind Regards,
>> -Greg
>>
>>
>>
>

^ permalink raw reply

* Re: [PATCH v3 02/11] memcg: document cgroup dirty memory interfaces
From: KAMEZAWA Hiroyuki @ 2010-10-20  4:06 UTC (permalink / raw)
  To: Greg Thelen
  Cc: Daisuke Nishimura, Andrew Morton, linux-kernel, linux-mm,
	containers, Andrea Righi, Balbir Singh, Minchan Kim, Ciju Rajan K,
	David Rientjes
In-Reply-To: <xr93r5fl1poc.fsf@ninji.mtv.corp.google.com>

On Tue, 19 Oct 2010 17:45:08 -0700
Greg Thelen <gthelen@google.com> wrote:

> KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> writes:
> > BTW, how about supporing dirty_limit_in_bytes when use_hierarchy=0 or
> > leave it as broken when use_hierarchy=1 ?  It seems we can only
> > support dirty_ratio when hierarchy is used.
> 
> I am not sure what you mean here.

When using dirty_ratio, we can check the value of dirty_ratio at setting it
and make guarantee that any children's dirty_ratio cannot exceeds it parent's.

If we guarantee that, we can keep dirty_ratio even under hierarchy.

When it comes to dirty_limit_in_bytes, we never able to do such kind of
controls. So, it will be broken and will do different behavior than
dirty_ratio.

So, not supporing dirty_bytes when use_hierarchy==1 for now sounds reasonable to me.

Thanks,
-Kame






^ permalink raw reply

* Re: [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available
From: Joey Lee @ 2010-10-20  4:12 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: corentin.chary, Greg Kroah-Hartman, Takashi Iwai,
	Thomas Renninger, mjg59, carlos, jbenc, linux-input,
	platform-driver-x86

Hi Dmitry, 

Thank's for your review.

於 一,2010-10-18 於 08:55 -0700,Dmitry Torokhov 提到:
> Hi,
> 
> On Mon, Oct 18, 2010 at 11:07:43PM +0800, Lee, Chun-Yi wrote:
> > +static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
> > +{
> > +	/* We are looking for OEM-specific Type Aah */
> > +	if (header->type != ACER_DMI_DEV_TYPE_AA)
> > +		return;
> > +
> > +	type_aa = (struct hotkey_function_type_aa *) header;
> > +
> > +	printk(ACER_INFO "Function biti map for Communication Button: 0x%x\n",
> > +		type_aa->commun_func_bitmap);
> > +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS))
> > +		interface->capability |= ACER_CAP_WIRELESS;
> > +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_THREEG))
> > +		interface->capability |= ACER_CAP_THREEG;
> > +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH))
> > +		interface->capability |= ACER_CAP_BLUETOOTH;
> 
> The "!!" is completely redundant here.
> 

Sorry my fail, removed.

> > +}
> > +
> >  static acpi_status WMID_set_capabilities(void)
> >  {
> >  	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
> > @@ -844,16 +875,17 @@ static acpi_status WMID_set_capabilities(void)
> >  		return AE_ERROR;
> >  	}
> >  
> > -	/* Not sure on the meaning of the relevant bits yet to detect these */
> > -	interface->capability |= ACER_CAP_WIRELESS;
> > -	interface->capability |= ACER_CAP_THREEG;
> > +	dmi_walk(type_aa_dmi_decode, NULL);
> > +	if (!type_aa) {
> > +		interface->capability |= ACER_CAP_WIRELESS;
> > +		interface->capability |= ACER_CAP_THREEG;
> > +		if (devices & 0x10)
> > +			interface->capability |= ACER_CAP_BLUETOOTH;
> > +	}
> 
> Since you are storing "type_aa" anyways it probably would be better to
> set all capabilities here, in one place...
> 

Follow your suggestion to modified the patch like following:


From ca67b42b36dea9b5e8d3ac8560f29622447ea470 Mon Sep 17 00:00:00 2001
From: Lee, Chun-Yi <jlee@novell.com>
Date: Wed, 20 Oct 2010 10:50:46 +0100
Subject: [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available

Check the Acer OEM-specific Type AA to detect the WiFi/Bluetooth/3G
devices available or not, and set the devices capability flag.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
 drivers/platform/x86/acer-wmi.c |   50
++++++++++++++++++++++++++++++++------
 1 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c
b/drivers/platform/x86/acer-wmi.c
index 7a17ebe..a5ac42c 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -39,6 +39,7 @@
 #include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/input/sparse-keymap.h>
+#include <linux/dmi.h>
 
 #include <acpi/acpi_drivers.h>
 
@@ -138,7 +139,9 @@ struct lm_return_value {
 /*
  * GUID3 Get Device Status device flags
  */
-#define ACER_WMID3_GDS_THREEG		(1<<6)	/* 3G */
+#define ACER_WMID3_GDS_WIRELESS           (1<<0)  /* WiFi */
+#define ACER_WMID3_GDS_THREEG             (1<<6)  /* 3G */
+#define ACER_WMID3_GDS_BLUETOOTH          (1<<11) /* BT */
 
 struct wmid3_gds_input_param {	/* Get Device Status input parameter */
 	u8 function_num;	/* Function Number */
@@ -153,6 +156,15 @@ struct wmid3_gds_return_value {	/* Get Device
Status return value*/
 	u32 reserved;
 } __attribute__((packed));
 
+#define ACER_DMI_DEV_TYPE_AA		170
+
+struct hotkey_function_type_aa {
+	u8 type;
+	u8 length;
+	u16 handle;
+	u16 commun_func_bitmap;
+} __attribute__((packed));
+
 /*
  * Interface capability flags
  */
@@ -184,6 +196,7 @@ static int brightness = -1;
 static int threeg = -1;
 static int force_series;
 static bool launch_manager;
+static struct hotkey_function_type_aa *type_aa;
 
 module_param(mailled, int, 0444);
 module_param(brightness, int, 0444);
@@ -824,6 +837,18 @@ static acpi_status WMID_set_u32(u32 value, u32 cap,
struct wmi_interface *iface)
 	return WMI_execute_u32(method_id, (u32)value, NULL);
 }
 
+static void type_aa_dmi_decode(const struct dmi_header *header, void
*dummy)
+{
+	/* We are looking for OEM-specific Type Aah */
+	if (header->type != ACER_DMI_DEV_TYPE_AA)
+		return;
+
+	type_aa = (struct hotkey_function_type_aa *) header;
+
+	printk(ACER_INFO "Function biti map for Communication Button: 0x%x\n",
+		type_aa->commun_func_bitmap);
+}
+
 static acpi_status WMID_set_capabilities(void)
 {
 	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -844,16 +869,24 @@ static acpi_status WMID_set_capabilities(void)
 		return AE_ERROR;
 	}
 
-	/* Not sure on the meaning of the relevant bits yet to detect these */
-	interface->capability |= ACER_CAP_WIRELESS;
-	interface->capability |= ACER_CAP_THREEG;
+	dmi_walk(type_aa_dmi_decode, NULL);
+	if (type_aa) {
+		if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS)
+			interface->capability |= ACER_CAP_WIRELESS;
+		if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_THREEG)
+			interface->capability |= ACER_CAP_THREEG;
+		if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
+			interface->capability |= ACER_CAP_BLUETOOTH;
+	} else {
+		interface->capability |= ACER_CAP_WIRELESS;
+		interface->capability |= ACER_CAP_THREEG;
+		if (devices & 0x10)
+			interface->capability |= ACER_CAP_BLUETOOTH;
+	}
 
 	/* WMID always provides brightness methods */
 	interface->capability |= ACER_CAP_BRIGHTNESS;
 
-	if (devices & 0x10)
-		interface->capability |= ACER_CAP_BLUETOOTH;
-
 	if (!(devices & 0x20))
 		max_brightness = 0x9;
 
@@ -932,7 +965,8 @@ static void __init acer_commandline_init(void)
 	 * capability isn't available on the given interface
 	 */
 	set_u32(mailled, ACER_CAP_MAILLED);
-	set_u32(threeg, ACER_CAP_THREEG);
+	if (!type_aa)
+		set_u32(threeg, ACER_CAP_THREEG);
 	set_u32(brightness, ACER_CAP_BRIGHTNESS);
 }
 
-- 
1.6.0.2



--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 related

* Re: [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available
From: Joey Lee @ 2010-10-20  4:12 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: corentin.chary, Greg Kroah-Hartman, Takashi Iwai,
	Thomas Renninger, mjg59, carlos, jbenc, linux-input,
	platform-driver-x86

Hi Dmitry, 

Thank's for your review.

於 一,2010-10-18 於 08:55 -0700,Dmitry Torokhov 提到:
> Hi,
> 
> On Mon, Oct 18, 2010 at 11:07:43PM +0800, Lee, Chun-Yi wrote:
> > +static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
> > +{
> > +	/* We are looking for OEM-specific Type Aah */
> > +	if (header->type != ACER_DMI_DEV_TYPE_AA)
> > +		return;
> > +
> > +	type_aa = (struct hotkey_function_type_aa *) header;
> > +
> > +	printk(ACER_INFO "Function biti map for Communication Button: 0x%x\n",
> > +		type_aa->commun_func_bitmap);
> > +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS))
> > +		interface->capability |= ACER_CAP_WIRELESS;
> > +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_THREEG))
> > +		interface->capability |= ACER_CAP_THREEG;
> > +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH))
> > +		interface->capability |= ACER_CAP_BLUETOOTH;
> 
> The "!!" is completely redundant here.
> 

Sorry my fail, removed.

> > +}
> > +
> >  static acpi_status WMID_set_capabilities(void)
> >  {
> >  	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
> > @@ -844,16 +875,17 @@ static acpi_status WMID_set_capabilities(void)
> >  		return AE_ERROR;
> >  	}
> >  
> > -	/* Not sure on the meaning of the relevant bits yet to detect these */
> > -	interface->capability |= ACER_CAP_WIRELESS;
> > -	interface->capability |= ACER_CAP_THREEG;
> > +	dmi_walk(type_aa_dmi_decode, NULL);
> > +	if (!type_aa) {
> > +		interface->capability |= ACER_CAP_WIRELESS;
> > +		interface->capability |= ACER_CAP_THREEG;
> > +		if (devices & 0x10)
> > +			interface->capability |= ACER_CAP_BLUETOOTH;
> > +	}
> 
> Since you are storing "type_aa" anyways it probably would be better to
> set all capabilities here, in one place...
> 

Follow your suggestion to modified the patch like following:


>From ca67b42b36dea9b5e8d3ac8560f29622447ea470 Mon Sep 17 00:00:00 2001
From: Lee, Chun-Yi <jlee@novell.com>
Date: Wed, 20 Oct 2010 10:50:46 +0100
Subject: [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available

Check the Acer OEM-specific Type AA to detect the WiFi/Bluetooth/3G
devices available or not, and set the devices capability flag.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
 drivers/platform/x86/acer-wmi.c |   50
++++++++++++++++++++++++++++++++------
 1 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c
b/drivers/platform/x86/acer-wmi.c
index 7a17ebe..a5ac42c 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -39,6 +39,7 @@
 #include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/input/sparse-keymap.h>
+#include <linux/dmi.h>
 
 #include <acpi/acpi_drivers.h>
 
@@ -138,7 +139,9 @@ struct lm_return_value {
 /*
  * GUID3 Get Device Status device flags
  */
-#define ACER_WMID3_GDS_THREEG		(1<<6)	/* 3G */
+#define ACER_WMID3_GDS_WIRELESS           (1<<0)  /* WiFi */
+#define ACER_WMID3_GDS_THREEG             (1<<6)  /* 3G */
+#define ACER_WMID3_GDS_BLUETOOTH          (1<<11) /* BT */
 
 struct wmid3_gds_input_param {	/* Get Device Status input parameter */
 	u8 function_num;	/* Function Number */
@@ -153,6 +156,15 @@ struct wmid3_gds_return_value {	/* Get Device
Status return value*/
 	u32 reserved;
 } __attribute__((packed));
 
+#define ACER_DMI_DEV_TYPE_AA		170
+
+struct hotkey_function_type_aa {
+	u8 type;
+	u8 length;
+	u16 handle;
+	u16 commun_func_bitmap;
+} __attribute__((packed));
+
 /*
  * Interface capability flags
  */
@@ -184,6 +196,7 @@ static int brightness = -1;
 static int threeg = -1;
 static int force_series;
 static bool launch_manager;
+static struct hotkey_function_type_aa *type_aa;
 
 module_param(mailled, int, 0444);
 module_param(brightness, int, 0444);
@@ -824,6 +837,18 @@ static acpi_status WMID_set_u32(u32 value, u32 cap,
struct wmi_interface *iface)
 	return WMI_execute_u32(method_id, (u32)value, NULL);
 }
 
+static void type_aa_dmi_decode(const struct dmi_header *header, void
*dummy)
+{
+	/* We are looking for OEM-specific Type Aah */
+	if (header->type != ACER_DMI_DEV_TYPE_AA)
+		return;
+
+	type_aa = (struct hotkey_function_type_aa *) header;
+
+	printk(ACER_INFO "Function biti map for Communication Button: 0x%x\n",
+		type_aa->commun_func_bitmap);
+}
+
 static acpi_status WMID_set_capabilities(void)
 {
 	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -844,16 +869,24 @@ static acpi_status WMID_set_capabilities(void)
 		return AE_ERROR;
 	}
 
-	/* Not sure on the meaning of the relevant bits yet to detect these */
-	interface->capability |= ACER_CAP_WIRELESS;
-	interface->capability |= ACER_CAP_THREEG;
+	dmi_walk(type_aa_dmi_decode, NULL);
+	if (type_aa) {
+		if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS)
+			interface->capability |= ACER_CAP_WIRELESS;
+		if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_THREEG)
+			interface->capability |= ACER_CAP_THREEG;
+		if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
+			interface->capability |= ACER_CAP_BLUETOOTH;
+	} else {
+		interface->capability |= ACER_CAP_WIRELESS;
+		interface->capability |= ACER_CAP_THREEG;
+		if (devices & 0x10)
+			interface->capability |= ACER_CAP_BLUETOOTH;
+	}
 
 	/* WMID always provides brightness methods */
 	interface->capability |= ACER_CAP_BRIGHTNESS;
 
-	if (devices & 0x10)
-		interface->capability |= ACER_CAP_BLUETOOTH;
-
 	if (!(devices & 0x20))
 		max_brightness = 0x9;
 
@@ -932,7 +965,8 @@ static void __init acer_commandline_init(void)
 	 * capability isn't available on the given interface
 	 */
 	set_u32(mailled, ACER_CAP_MAILLED);
-	set_u32(threeg, ACER_CAP_THREEG);
+	if (!type_aa)
+		set_u32(threeg, ACER_CAP_THREEG);
 	set_u32(brightness, ACER_CAP_BRIGHTNESS);
 }
 
-- 
1.6.0.2



--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 related

* [linux-dvb] kworld atsc120 tuner problems....
From: RickCharter @ 2010-10-20  4:11 UTC (permalink / raw)
  To: linux-dvb

  Starting with the 2.6.35 kernels, my KWorld ATSC120 tuner will not 
lock on to any channels.  Everything works fine up to 2.6.34.7, but will 
not work with the newer kernels.  This card uses CX88-dvb, s5h1409, and 
xc2028/3028 modules, and all modules load without any errors. Firmware 
loads properly. In my /var/log/messages files, I get:

Oct 19 22:46:03 slackware kernel: cx88[0]: Calling XC2028/3028 callback
Oct 19 22:46:31 slackware last message repeated 25 times
Oct 19 22:46:33 slackware kernel: cx88[0]: Calling XC2028/3028 callback
Oct 19 22:47:04 slackware last message repeated 28 times
Oct 19 22:48:05 slackware last message repeated 55 times
Oct 19 22:49:03 slackware last message repeated 39 times
Oct 19 22:54:58 slackware kernel: cx88[0]: Calling XC2028/3028 callback
Oct 19 22:55:59 slackware last message repeated 48 times
Oct 19 22:56:02 slackware last message repeated 3 times

Tried to tune a channel in Kaffeine, get: kaffeine(2015) 
DvbDevice::frontendEvent: tuning failed

Xine and mplayer freeze trying to channel lock, Mythtv cannot lock on 
any channel.

Tried using a rc7 of the 2.36 kernel, get same problem... nothing after 
2.6.34.7 seems to work!

_______________________________________________
linux-dvb users mailing list
For V4L/DVB development, please use instead linux-media@vger.kernel.org
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

^ permalink raw reply

* Re: read/write on RADOS using external buffer
From: Gregory Farnum @ 2010-10-20  4:10 UTC (permalink / raw)
  To: Takuya ASADA; +Cc: Sage Weil, ceph-devel
In-Reply-To: <20101019222727.GA1737@enoki.dokukino.com>

Takuya:
At first glance this looks okay, but we're going to want to review it
carefully given the changes to SimpleMessenger, and check its impact
on performance, etc to decide if this is something we actually want to
merge, or if we'd like to implement this as a derivative messenger or
something. :)
Could you let us know how you've been testing this? :)
-Greg

On Tue, Oct 19, 2010 at 3:27 PM, Takuya ASADA <syuu@dokukino.com> wrote:
> Hi,
>
> I just implemented the patch to support external buffer on Rados::read() and Rados::write().
>
> diff --git a/src/include/librados.hpp b/src/include/librados.hpp
> index 06fa3b2..bfb0f5b 100644
> --- a/src/include/librados.hpp
> +++ b/src/include/librados.hpp
> @@ -63,8 +63,10 @@ public:
>   int create(pool_t pool, const std::string& oid, bool exclusive);
>
>   int write(pool_t pool, const std::string& oid, off_t off, bufferlist& bl, size_t len);
> +  int write(pool_t pool, const std::string& oid, off_t off, void *buf, size_t len);
>   int write_full(pool_t pool, const std::string& oid, bufferlist& bl);
>   int read(pool_t pool, const std::string& oid, off_t off, bufferlist& bl, size_t len);
> +  int read(pool_t pool, const std::string& oid, off_t off, void *buf, size_t len);
>   int remove(pool_t pool, const std::string& oid);
>   int trunc(pool_t pool, const std::string& oid, size_t size);
>
> @@ -135,4 +137,3 @@ public:
>  }
>
>  #endif
> -
> diff --git a/src/librados.cc b/src/librados.cc
> index 4c8a464..91e6a27 100644
> --- a/src/librados.cc
> +++ b/src/librados.cc
> @@ -72,11 +72,12 @@ class RadosClient : public Dispatcher
>
>   Mutex lock;
>   Cond cond;
> +  static hash_map<tid_t, bufferptr*> buffer_map;
> +  static bufferptr* fetch_buffer_func(tid_t tid);
>
> -
>  public:
>   RadosClient() : messenger(NULL), lock("radosclient") {
> -    messenger = new SimpleMessenger();
> +    messenger = new SimpleMessenger(&RadosClient::fetch_buffer_func);
>   }
>
>   ~RadosClient();
> @@ -132,8 +133,10 @@ public:
>   // io
>   int create(PoolCtx& pool, const object_t& oid, bool exclusive);
>   int write(PoolCtx& pool, const object_t& oid, off_t off, bufferlist& bl, size_t len);
> +  int write(PoolCtx& pool, const object_t& oid, off_t off, void *buf, size_t len);
>   int write_full(PoolCtx& pool, const object_t& oid, bufferlist& bl);
>   int read(PoolCtx& pool, const object_t& oid, off_t off, bufferlist& bl, size_t len);
> +  int read(PoolCtx& pool, const object_t& oid, off_t off, void *buf, size_t len);
>   int remove(PoolCtx& pool, const object_t& oid);
>   int stat(PoolCtx& pool, const object_t& oid, uint64_t *psize, time_t *pmtime);
>   int trunc(PoolCtx& pool, const object_t& oid, size_t size);
> @@ -870,6 +873,15 @@ int RadosClient::write(PoolCtx& pool, const object_t& oid, off_t off, bufferlist
>   return len;
>  }
>
> +int RadosClient::write(PoolCtx& pool, const object_t& oid, off_t off, void *buf, size_t len)
> +{
> +  bufferptr bp = buffer::create_static(len, static_cast<char *>(buf));
> +  bufferlist bl;
> +
> +  bl.push_back(bp);
> +  return write(pool, oid, off, bl, len);
> +}
> +
>  int RadosClient::write_full(PoolCtx& pool, const object_t& oid, bufferlist& bl)
>  {
>   utime_t ut = g_clock.now();
> @@ -1116,6 +1128,46 @@ int RadosClient::read(PoolCtx& pool, const object_t& oid, off_t off, bufferlist&
>   return bl.length();
>  }
>
> +int RadosClient::read(PoolCtx& pool, const object_t& oid, off_t off, void *buf, size_t len)
> +{
> +  SnapContext snapc;
> +
> +  Mutex mylock("RadosClient::read::mylock");
> +  Cond cond;
> +  bool done;
> +  int r;
> +  Context *onack = new C_SafeCond(&mylock, &cond, &done, &r);
> +  bufferptr bp = buffer::create_static(len, static_cast<char *>(buf));
> +  bufferlist bl;
> +
> +  bl.push_back(bp);
> +  lock.Lock();
> +  ceph_object_layout layout = objecter->osdmap->make_object_layout(oid, pool.poolid);
> +  tid_t tid = objecter->get_tid();
> +  buffer_map[tid] = &bp;
> +  objecter->read_with_tid(oid, layout,
> +             off, len, pool.snap_seq, &bl, 0,
> +             onack, tid);
> +  lock.Unlock();
> +
> +  mylock.Lock();
> +  while (!done)
> +    cond.Wait(mylock);
> +  mylock.Unlock();
> +  buffer_map.erase(tid);
> +  dout(10) << "Objecter returned from read r=" << r << dendl;
> +
> +  if (r < 0)
> +    return r;
> +
> +  if (bl.length() < len) {
> +    dout(10) << "Returned length " << bl.length()
> +            << " less than original length "<< len << dendl;
> +  }
> +
> +  return bl.length();
> +}
> +
>  int RadosClient::stat(PoolCtx& pool, const object_t& oid, uint64_t *psize, time_t *pmtime)
>  {
>   SnapContext snapc;
> @@ -1251,6 +1303,13 @@ int RadosClient::getxattrs(PoolCtx& pool, const object_t& oid, map<std::string,
>   return r;
>  }
>
> +hash_map<tid_t, bufferptr*> RadosClient::buffer_map;
> +
> +bufferptr* RadosClient::fetch_buffer_func(tid_t tid)
> +{
> +  return buffer_map[tid];
> +}
> +
>  // ---------------------------------------------
>
>  namespace librados {
> @@ -1401,6 +1460,14 @@ int Rados::write(rados_pool_t pool, const string& o, off_t off, bufferlist& bl,
>   return ((RadosClient *)client)->write(*(RadosClient::PoolCtx *)pool, oid, off, bl, len);
>  }
>
> +int Rados::write(rados_pool_t pool, const string& o, off_t off, void *buf, size_t len)
> +{
> +  if (!client)
> +    return -EINVAL;
> +  object_t oid(o);
> +  return ((RadosClient *)client)->write(*(RadosClient::PoolCtx *)pool, oid, off, buf, len);
> +}
> +
>  int Rados::write_full(rados_pool_t pool, const string& o, bufferlist& bl)
>  {
>   if (!client)
> @@ -1433,6 +1500,14 @@ int Rados::read(rados_pool_t pool, const string& o, off_t off, bufferlist& bl, s
>   return ((RadosClient *)client)->read(*(RadosClient::PoolCtx *)pool, oid, off, bl, len);
>  }
>
> +int Rados::read(rados_pool_t pool, const string& o, off_t off, void *buf, size_t len)
> +{
> +  if (!client)
> +    return -EINVAL;
> +  object_t oid(o);
> +  return ((RadosClient *)client)->read(*(RadosClient::PoolCtx *)pool, oid, off, buf, len);
> +}
> +
>  int Rados::getxattr(rados_pool_t pool, const string& o, const char *name, bufferlist& bl)
>  {
>   if (!client)
> diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc
> index 4632267..75b4576 100644
> --- a/src/msg/SimpleMessenger.cc
> +++ b/src/msg/SimpleMessenger.cc
> @@ -51,7 +51,7 @@ static ostream& _prefix(SimpleMessenger *messenger) {
>  #define closed_socket() //dout(20) << "closed_socket " << --sockopen << dendl;
>  #define opened_socket() //dout(20) << "opened_socket " << ++sockopen << dendl;
>
> -
> +SimpleMessenger::fetch_buffer_callback_t SimpleMessenger::fetch_buffer_callback = 0;
>
>  /********************************************
>  * Accepter
> @@ -1786,36 +1786,47 @@ int SimpleMessenger::Pipe::read_message(Message **pm)
>   data_len = le32_to_cpu(header.data_len);
>   data_off = le32_to_cpu(header.data_off);
>   if (data_len) {
> -    int left = data_len;
> -    if (data_off & ~PAGE_MASK) {
> -      // head
> -      int head = MIN(PAGE_SIZE - (data_off & ~PAGE_MASK),
> -                    (unsigned)left);
> -      bufferptr bp = buffer::create(head);
> -      if (tcp_read( sd, bp.c_str(), head, messenger->timeout ) < 0)
> +    if (fetch_buffer_callback) {
> +      bufferptr *bpp = fetch_buffer_callback(header.tid);
> +      if (!bpp)
> +       goto allocate_buffer;
> +      if (tcp_read( sd, bpp->c_str(), data_len, messenger->timeout ) < 0)
>        goto out_dethrottle;
> -      data.push_back(bp);
> -      left -= head;
> -      dout(20) << "reader got data head " << head << dendl;
> -    }
> +      data.push_back(*bpp);
> +      dout(20) << "reader got data " << data_len << dendl;
> +    }else{
> +    allocate_buffer:
> +      int left = data_len;
> +      if (data_off & ~PAGE_MASK) {
> +       // head
> +       int head = MIN(PAGE_SIZE - (data_off & ~PAGE_MASK),
> +                      (unsigned)left);
> +       bufferptr bp = buffer::create(head);
> +       if (tcp_read( sd, bp.c_str(), head, messenger->timeout ) < 0)
> +         goto out_dethrottle;
> +       data.push_back(bp);
> +       left -= head;
> +       dout(20) << "reader got data head " << head << dendl;
> +      }
>
> -    // middle
> -    int middle = left & PAGE_MASK;
> -    if (middle > 0) {
> -      bufferptr bp = buffer::create_page_aligned(middle);
> -      if (tcp_read( sd, bp.c_str(), middle, messenger->timeout ) < 0)
> -       goto out_dethrottle;
> -      data.push_back(bp);
> -      left -= middle;
> -      dout(20) << "reader got data page-aligned middle " << middle << dendl;
> -    }
> +      // middle
> +      int middle = left & PAGE_MASK;
> +      if (middle > 0) {
> +       bufferptr bp = buffer::create_page_aligned(middle);
> +       if (tcp_read( sd, bp.c_str(), middle, messenger->timeout ) < 0)
> +         goto out_dethrottle;
> +       data.push_back(bp);
> +       left -= middle;
> +       dout(20) << "reader got data page-aligned middle " << middle << dendl;
> +      }
>
> -    if (left) {
> -      bufferptr bp = buffer::create(left);
> -      if (tcp_read( sd, bp.c_str(), left, messenger->timeout ) < 0)
> -       goto out_dethrottle;
> -      data.push_back(bp);
> -      dout(20) << "reader got data tail " << left << dendl;
> +      if (left) {
> +       bufferptr bp = buffer::create(left);
> +       if (tcp_read( sd, bp.c_str(), left, messenger->timeout ) < 0)
> +         goto out_dethrottle;
> +       data.push_back(bp);
> +       dout(20) << "reader got data tail " << left << dendl;
> +      }
>     }
>   }
>
> diff --git a/src/msg/SimpleMessenger.h b/src/msg/SimpleMessenger.h
> index b4a0ef3..72a5a1b 100644
> --- a/src/msg/SimpleMessenger.h
> +++ b/src/msg/SimpleMessenger.h
> @@ -567,6 +567,9 @@ private:
>   SimpleMessenger *messenger; //hack to make dout macro work, will fix
>   int timeout;
>
> +  typedef bufferptr* (*fetch_buffer_callback_t) (tid_t);
> +  static fetch_buffer_callback_t fetch_buffer_callback;
> +
>  public:
>   SimpleMessenger() :
>     Messenger(entity_name_t()),
> @@ -580,6 +583,20 @@ public:
>     // for local dmsg delivery
>     dispatch_queue.local_pipe = new Pipe(this, Pipe::STATE_OPEN);
>   }
> +
> +  SimpleMessenger(fetch_buffer_callback_t callback) :
> +    Messenger(entity_name_t()),
> +    accepter(this),
> +    lock("SimpleMessenger::lock"), started(false), did_bind(false),
> +    dispatch_throttler(g_conf.ms_dispatch_throttle_bytes), need_addr(true),
> +    destination_stopped(true), my_type(-1),
> +    global_seq_lock("SimpleMessenger::global_seq_lock"), global_seq(0),
> +    reaper_thread(this), reaper_started(false), reaper_stop(false),
> +    dispatch_thread(this), messenger(this) {
> +    fetch_buffer_callback = callback;
> +    // for local dmsg delivery
> +    dispatch_queue.local_pipe = new Pipe(this, Pipe::STATE_OPEN);
> +  }
>   ~SimpleMessenger() {
>     delete dispatch_queue.local_pipe;
>   }
> diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h
> index a34c0a9..fd43795 100644
> --- a/src/osdc/Objecter.h
> +++ b/src/osdc/Objecter.h
> @@ -530,6 +530,21 @@ private:
>     o->outbl = pbl;
>     return op_submit(o);
>   }
> +  tid_t read_with_tid(const object_t& oid, ceph_object_layout ol,
> +            uint64_t off, uint64_t len, snapid_t snap, bufferlist *pbl, int flags,
> +            Context *onfinish, tid_t tid) {
> +    vector<OSDOp> ops(1);
> +    ops[0].op.op = CEPH_OSD_OP_READ;
> +    ops[0].op.extent.offset = off;
> +    ops[0].op.extent.length = len;
> +    ops[0].op.extent.truncate_size = 0;
> +    ops[0].op.extent.truncate_seq = 0;
> +    Op *o = new Op(oid, ol, ops, flags, onfinish, 0);
> +    o->snapid = snap;
> +    o->outbl = pbl;
> +    o->tid = tid;
> +    return op_submit(o);
> +  }
>   tid_t read_trunc(const object_t& oid, ceph_object_layout ol,
>             uint64_t off, uint64_t len, snapid_t snap, bufferlist *pbl, int flags,
>             uint64_t trunc_size, __u32 trunc_seq,
> @@ -725,6 +740,8 @@ private:
>
>   void list_objects(ListContext *p, Context *onfinish);
>
> +  tid_t get_tid(void) { return ++last_tid; }
> +
>   // -------------------------
>   // pool ops
>  private:
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" 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: [PATCH v3 07/11] memcg: add dirty limits to mem_cgroup
From: Greg Thelen @ 2010-10-20  4:08 UTC (permalink / raw)
  To: Daisuke Nishimura
  Cc: Andrew Morton, linux-kernel, linux-mm, containers, Andrea Righi,
	Balbir Singh, KAMEZAWA Hiroyuki, Minchan Kim, Ciju Rajan K,
	David Rientjes
In-Reply-To: <20101020095056.48098b34.nishimura@mxp.nes.nec.co.jp>

Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> writes:

>> +static unsigned long long
>> +memcg_hierarchical_free_pages(struct mem_cgroup *mem)
>> +{
>> +	struct cgroup *cgroup;
>> +	unsigned long long min_free, free;
>> +
>> +	min_free = res_counter_read_u64(&mem->res, RES_LIMIT) -
>> +		res_counter_read_u64(&mem->res, RES_USAGE);
>> +	cgroup = mem->css.cgroup;
>> +	if (!mem->use_hierarchy)
>> +		goto out;
>> +
>> +	while (cgroup->parent) {
>> +		cgroup = cgroup->parent;
>> +		mem = mem_cgroup_from_cont(cgroup);
>> +		if (!mem->use_hierarchy)
>> +			break;
>> +		free = res_counter_read_u64(&mem->res, RES_LIMIT) -
>> +			res_counter_read_u64(&mem->res, RES_USAGE);
>> +		min_free = min(min_free, free);
>> +	}
>> +out:
>> +	/* Translate free memory in pages */
>> +	return min_free >> PAGE_SHIFT;
>> +}
>> +
> I think you can simplify this function using parent_mem_cgroup().
>
> 	unsigned long free, min_free = ULLONG_MAX;
>
> 	while (mem) {
> 		free = res_counter_read_u64(&mem->res, RES_LIMIT) -
> 			res_counter_read_u64(&mem->res, RES_USAGE);
> 		min_free = min(min_free, free);
> 		mem = parent_mem_cgroup();
> 	}
>
> 	/* Translate free memory in pages */
> 	return min_free >> PAGE_SHIFT;
>
> And, IMHO, we should return min(global_page_state(NR_FREE_PAGES), min_free >> PAGE_SHIFT).
> Because we are allowed to set no-limit(or a very big limit) in memcg,
> so min_free can be very big if we don't set a limit against all the memcg's in hierarchy.
>
>
> Thanks,
> Dasiuke Nishimura.

Thank you.  This is a good suggestion.  I will update the page to include this.

--
Greg

^ permalink raw reply

* Re: [PATCH v3 07/11] memcg: add dirty limits to mem_cgroup
From: Greg Thelen @ 2010-10-20  4:08 UTC (permalink / raw)
  To: Daisuke Nishimura
  Cc: Andrew Morton, linux-kernel, linux-mm, containers, Andrea Righi,
	Balbir Singh, KAMEZAWA Hiroyuki, Minchan Kim, Ciju Rajan K,
	David Rientjes
In-Reply-To: <20101020095056.48098b34.nishimura@mxp.nes.nec.co.jp>

Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> writes:

>> +static unsigned long long
>> +memcg_hierarchical_free_pages(struct mem_cgroup *mem)
>> +{
>> +	struct cgroup *cgroup;
>> +	unsigned long long min_free, free;
>> +
>> +	min_free = res_counter_read_u64(&mem->res, RES_LIMIT) -
>> +		res_counter_read_u64(&mem->res, RES_USAGE);
>> +	cgroup = mem->css.cgroup;
>> +	if (!mem->use_hierarchy)
>> +		goto out;
>> +
>> +	while (cgroup->parent) {
>> +		cgroup = cgroup->parent;
>> +		mem = mem_cgroup_from_cont(cgroup);
>> +		if (!mem->use_hierarchy)
>> +			break;
>> +		free = res_counter_read_u64(&mem->res, RES_LIMIT) -
>> +			res_counter_read_u64(&mem->res, RES_USAGE);
>> +		min_free = min(min_free, free);
>> +	}
>> +out:
>> +	/* Translate free memory in pages */
>> +	return min_free >> PAGE_SHIFT;
>> +}
>> +
> I think you can simplify this function using parent_mem_cgroup().
>
> 	unsigned long free, min_free = ULLONG_MAX;
>
> 	while (mem) {
> 		free = res_counter_read_u64(&mem->res, RES_LIMIT) -
> 			res_counter_read_u64(&mem->res, RES_USAGE);
> 		min_free = min(min_free, free);
> 		mem = parent_mem_cgroup();
> 	}
>
> 	/* Translate free memory in pages */
> 	return min_free >> PAGE_SHIFT;
>
> And, IMHO, we should return min(global_page_state(NR_FREE_PAGES), min_free >> PAGE_SHIFT).
> Because we are allowed to set no-limit(or a very big limit) in memcg,
> so min_free can be very big if we don't set a limit against all the memcg's in hierarchy.
>
>
> Thanks,
> Dasiuke Nishimura.

Thank you.  This is a good suggestion.  I will update the page to include this.

--
Greg

--
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 v3] add icswx support
From: Tseng-Hui (Frank) Lin @ 2010-10-20  4:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tsenglin

icswx is a PowerPC co-processor instruction to send data to a
co-processor. On Book-S processors the LPAR_ID and process ID (PID) of
the owning process are registered in the window context of the
co-processor at initial time. When the icswx instruction is executed,
the L2 generates a cop-reg transaction on PowerBus. The transaction has
no address and the processor does not perform an MMU access to
authenticate the transaction. The coprocessor compares the LPAR_ID and
the PID included in the transaction and the LPAR_ID and PID held in the
window context to determine if the process is authorized to generate the
transaction.

The OS needs to assign a 16-bit PID for the process. This cop-PID needs
to be updated during context switch. The cop-PID needs to be destroyed
when the context is destroyed.

Change log from v2:
- Make the code a CPU feature and return -NODEV if CPU doesn't have
  icswx co-processor instruction.
- Change the goto loop in use_cop() into a do-while loop.
- Change context destroy code into a new destroy_context_acop() function
  and #define it based on CONFIG_ICSWX.
- Remove mmput() from drop_cop().
- Fix some TAB/space problems.

Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
Signed-off-by: Tseng-Hui (Frank) Lin <thlin@linux.vnet.ibm.com>

---
 arch/powerpc/include/asm/cputable.h    |    4 +-
 arch/powerpc/include/asm/mmu-hash64.h  |    5 ++
 arch/powerpc/include/asm/mmu_context.h |    6 ++
 arch/powerpc/include/asm/reg.h         |   11 +++
 arch/powerpc/include/asm/reg_booke.h   |    3 -
 arch/powerpc/mm/mmu_context_hash64.c   |  109
++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/Kconfig.cputype |   17 +++++
 7 files changed, 151 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/include/asm/cputable.h
b/arch/powerpc/include/asm/cputable.h
index 3a40a99..bbb4e2c 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -198,6 +198,7 @@ extern const char *powerpc_base_platform;
 #define CPU_FTR_CP_USE_DCBTZ		LONG_ASM_CONST(0x0040000000000000)
 #define CPU_FTR_UNALIGNED_LD_STD	LONG_ASM_CONST(0x0080000000000000)
 #define CPU_FTR_ASYM_SMT		LONG_ASM_CONST(0x0100000000000000)
+#define CPU_FTR_ICSWX			LONG_ASM_CONST(0x0200000000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -413,7 +414,8 @@ extern const char *powerpc_base_platform;
 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
 	    CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
-	    CPU_FTR_DSCR | CPU_FTR_SAO  | CPU_FTR_ASYM_SMT)
+	    CPU_FTR_DSCR | CPU_FTR_SAO  | CPU_FTR_ASYM_SMT | \
+	    CPU_FTR_ICSWX)
 #define CPU_FTRS_CELL	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
diff --git a/arch/powerpc/include/asm/mmu-hash64.h
b/arch/powerpc/include/asm/mmu-hash64.h
index acac35d..6c1ab90 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -423,6 +423,11 @@ typedef struct {
 #ifdef CONFIG_PPC_SUBPAGE_PROT
 	struct subpage_prot_table spt;
 #endif /* CONFIG_PPC_SUBPAGE_PROT */
+#ifdef CONFIG_ICSWX
+	unsigned long acop;	/* mask of enabled coprocessor types */
+#define HASH64_MAX_PID (0xFFFF)
+	unsigned int acop_pid;	/* pid value used with coprocessors */
+#endif /* CONFIG_ICSWX */
 } mm_context_t;
 
 
diff --git a/arch/powerpc/include/asm/mmu_context.h
b/arch/powerpc/include/asm/mmu_context.h
index 81fb412..88118de 100644
--- a/arch/powerpc/include/asm/mmu_context.h
+++ b/arch/powerpc/include/asm/mmu_context.h
@@ -80,6 +80,12 @@ static inline void switch_mm(struct mm_struct *prev,
struct mm_struct *next,
 
 #define deactivate_mm(tsk,mm)	do { } while (0)
 
+#ifdef CONFIG_ICSWX
+extern void switch_cop(struct mm_struct *next);
+extern int use_cop(unsigned long acop, struct mm_struct *mm);
+extern void drop_cop(unsigned long acop, struct mm_struct *mm);
+#endif /* CONFIG_ICSWX */
+
 /*
  * After we have set current->mm to a new value, this activates
  * the context for the new mm so we see the new mappings.
diff --git a/arch/powerpc/include/asm/reg.h
b/arch/powerpc/include/asm/reg.h
index ff0005eec..b86d876 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -170,8 +170,19 @@
 #define SPEFSCR_FRMC 	0x00000003	/* Embedded FP rounding mode control
*/
 
 /* Special Purpose Registers (SPRNs)*/
+
+#ifdef CONFIG_40x
+#define SPRN_PID	0x3B1	/* Process ID */
+#else
+#define SPRN_PID	0x030	/* Process ID */
+#ifdef CONFIG_BOOKE
+#define SPRN_PID0	SPRN_PID/* Process ID Register 0 */
+#endif
+#endif
+
 #define SPRN_CTR	0x009	/* Count Register */
 #define SPRN_DSCR	0x11
+#define SPRN_ACOP	0x1F	/* Available Coprocessor Register */
 #define SPRN_CTRLF	0x088
 #define SPRN_CTRLT	0x098
 #define   CTRL_CT	0xc0000000	/* current thread */
diff --git a/arch/powerpc/include/asm/reg_booke.h
b/arch/powerpc/include/asm/reg_booke.h
index 667a498..5b0c781 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -150,8 +150,6 @@
  * or IBM 40x.
  */
 #ifdef CONFIG_BOOKE
-#define SPRN_PID	0x030	/* Process ID */
-#define SPRN_PID0	SPRN_PID/* Process ID Register 0 */
 #define SPRN_CSRR0	0x03A	/* Critical Save and Restore Register 0 */
 #define SPRN_CSRR1	0x03B	/* Critical Save and Restore Register 1 */
 #define SPRN_DEAR	0x03D	/* Data Error Address Register */
@@ -168,7 +166,6 @@
 #define SPRN_TCR	0x154	/* Timer Control Register */
 #endif /* Book E */
 #ifdef CONFIG_40x
-#define SPRN_PID	0x3B1	/* Process ID */
 #define SPRN_DBCR1	0x3BD	/* Debug Control Register 1 */		
 #define SPRN_ESR	0x3D4	/* Exception Syndrome Register */
 #define SPRN_DEAR	0x3D5	/* Data Error Address Register */
diff --git a/arch/powerpc/mm/mmu_context_hash64.c
b/arch/powerpc/mm/mmu_context_hash64.c
index 2535828..6ef6ce2 100644
--- a/arch/powerpc/mm/mmu_context_hash64.c
+++ b/arch/powerpc/mm/mmu_context_hash64.c
@@ -18,6 +18,7 @@
 #include <linux/mm.h>
 #include <linux/spinlock.h>
 #include <linux/idr.h>
+#include <linux/percpu.h>
 #include <linux/module.h>
 #include <linux/gfp.h>
 
@@ -26,6 +27,113 @@
 static DEFINE_SPINLOCK(mmu_context_lock);
 static DEFINE_IDA(mmu_context_ida);
 
+#ifdef CONFIG_ICSWX
+static DEFINE_SPINLOCK(mmu_context_acop_lock);
+static DEFINE_IDA(cop_ida);
+
+/* Lazy switch the ACOP register */
+static DEFINE_PER_CPU(unsigned long, acop_reg);
+
+void switch_cop(struct mm_struct *next)
+{
+	if (!cpu_has_feature(CPU_FTR_ICSWX))
+		return;
+
+	mtspr(SPRN_PID, next->context.acop_pid);
+	if (next->context.acop_pid &&
+	    __get_cpu_var(acop_reg) != next->context.acop) {
+		mtspr(SPRN_ACOP, next->context.acop);
+		__get_cpu_var(acop_reg) = next->context.acop;
+	}
+}
+EXPORT_SYMBOL(switch_cop);
+
+int use_cop(unsigned long acop, struct mm_struct *mm)
+{
+	int acop_pid;
+	int err;
+
+	if (!cpu_has_feature(CPU_FTR_ICSWX))
+		return -ENODEV;
+
+	if (!mm)
+		return -EINVAL;
+
+	if (!mm->context.acop_pid) {
+		if (!ida_pre_get(&cop_ida, GFP_KERNEL))
+			return -ENOMEM;
+		do {
+			spin_lock(&mmu_context_acop_lock);
+			err = ida_get_new_above(&cop_ida, 1, &acop_pid);
+			spin_unlock(&mmu_context_acop_lock);
+		} while (err == -EAGAIN);
+
+		if (err)
+			return err;
+
+		if (acop_pid > HASH64_MAX_PID) {
+			spin_lock(&mmu_context_acop_lock);
+			ida_remove(&cop_ida, acop_pid);
+			spin_unlock(&mmu_context_acop_lock);
+			return -EBUSY;
+		}
+		mm->context.acop_pid = acop_pid;
+		if (mm == current->active_mm)
+			mtspr(SPRN_PID,  mm->context.acop_pid);
+	}
+	spin_lock(&mmu_context_acop_lock);
+	mm->context.acop |= acop;
+	spin_unlock(&mmu_context_acop_lock);
+
+	get_cpu_var(acop_reg) = mm->context.acop;
+	if (mm == current->active_mm)
+		mtspr(SPRN_ACOP, mm->context.acop);
+	put_cpu_var(acop_reg);
+
+	return mm->context.acop_pid;
+}
+EXPORT_SYMBOL(use_cop);
+
+void drop_cop(unsigned long acop, struct mm_struct *mm)
+{
+	if (!cpu_has_feature(CPU_FTR_ICSWX))
+		return;
+
+	if (WARN_ON(!mm))
+		return;
+
+	spin_lock(&mmu_context_acop_lock);
+	mm->context.acop &= ~acop;
+	spin_unlock(&mmu_context_acop_lock);
+	if (!mm->context.acop) {
+		spin_lock(&mmu_context_acop_lock);
+		ida_remove(&cop_ida, mm->context.acop_pid);
+		spin_unlock(&mmu_context_acop_lock);
+		mm->context.acop_pid = 0;
+		if (mm == current->active_mm)
+			mtspr(SPRN_PID, mm->context.acop_pid);
+	} else {
+		get_cpu_var(acop_reg) = mm->context.acop;
+		if (mm == current->active_mm)
+			mtspr(SPRN_ACOP, mm->context.acop);
+		put_cpu_var(acop_reg);
+	}
+}
+EXPORT_SYMBOL(drop_cop);
+
+static void destroy_context_acop(struct mm_struct *mm)
+{
+	if (mm->context.acop_pid) {
+		spin_lock(&mmu_context_acop_lock);
+		ida_remove(&cop_ida, mm->context.acop_pid);
+		spin_unlock(&mmu_context_acop_lock);
+	}
+}
+
+#else
+#define destroy_context_acop(mm)
+#endif /* CONFIG_ICSWX */
+
 /*
  * The proto-VSID space has 2^35 - 1 segments available for user
mappings.
  * Each segment contains 2^28 bytes.  Each context maps 2^44 bytes,
@@ -93,6 +201,7 @@ EXPORT_SYMBOL_GPL(__destroy_context);
 
 void destroy_context(struct mm_struct *mm)
 {
+	destroy_context_acop(mm);
 	__destroy_context(mm->context.id);
 	subpage_prot_free(mm);
 	mm->context.id = NO_CONTEXT;
diff --git a/arch/powerpc/platforms/Kconfig.cputype
b/arch/powerpc/platforms/Kconfig.cputype
index d361f81..7678e29 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -220,6 +220,23 @@ config VSX
 
 	  If in doubt, say Y here.
 
+config ICSWX
+	bool "Support for PowerPC icswx co-processor instruction"
+	depends on POWER4
+	default n
+	---help---
+
+	  Enabling this option to turn on the PowerPC icswx co-processor
+	  instruction support for POWER7 or newer processors.
+	  This option is only useful if you have a processor that supports
+	  icswx co-processor instruction. It does not have any effect on
+	  processors without icswx co-processor instruction.
+
+	  This support slightly increases kernel memory usage.
+
+	  Say N if you do not have a PowerPC processor supporting icswx
+	  instruction and a PowerPC co-processor.
+
 config SPE
 	bool "SPE Support"
 	depends on E200 || (E500 && !PPC_E500MC)

^ permalink raw reply related

* Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_<level>
From: Joe Perches @ 2010-10-20  4:07 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jean Delvare, Hans de Goede, Alistair John Strachan,
	Henrik Rydberg, Mark M. Hoffman, Luca Tettamanti, Fenghua Yu,
	Juerg Haefliger, Eric Piel, Jim Cromie, Roger Lucas,
	lm-sensors@lm-sensors.org, LKML
In-Reply-To: <20101020035346.GA20178@ericsson.com>

On Tue, 2010-10-19 at 20:53 -0700, Guenter Roeck wrote:
> On Tue, Oct 19, 2010 at 11:34:18PM -0400, Joe Perches wrote:
> > On Tue, 2010-10-19 at 20:29 -0700, Guenter Roeck wrote:
> > > There are several lines longer than 80 characters.
> > > Does this rule no longer apply ?
> > 80 columns isn't checked for printk format strings.
> Interesting.
> > A kernel general preference may be to keep formats as
> > a single string without line breaks so that grep works
> > better.
> > > Oddly enough, there are only four checkpatch warnings about long lines,
> > > even though there are many more.
> > The version I use doesn't show any warnings.
> checkpatch.pl from both v2.6.36-rc7 and v2.6.36-rc6 do report warnings.
> Looks like those versions flag long lines for pr_warn. Is your version
> older or newer ?

Newer.  It adds pr_warn to the exempted list, not just pr_warning.

> Anyway, would it be possible to split the patch into one patch per file ?

Oh sure.  It's trivial to do that.

> I don't know how Jean thinks about it, but in my opinion it would be cleaner,
> permit revert on a single patch/file instead of having to revert the entire series,
> it would simplify review, and it would make it much easier to cherry-pick 
> pieces into other releases if needed.

Jean, do you have a preference?
I'll resubmit if you want it separated.


^ permalink raw reply

* Re: [lm-sensors] [PATCH] drivers/hwmon: Use pr_fmt and pr_<level>
From: Joe Perches @ 2010-10-20  4:07 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jean Delvare, Hans de Goede, Alistair John Strachan,
	Henrik Rydberg, Mark M. Hoffman, Luca Tettamanti, Fenghua Yu,
	Juerg Haefliger, Eric Piel, Jim Cromie, Roger Lucas,
	lm-sensors@lm-sensors.org, LKML
In-Reply-To: <20101020035346.GA20178@ericsson.com>

On Tue, 2010-10-19 at 20:53 -0700, Guenter Roeck wrote:
> On Tue, Oct 19, 2010 at 11:34:18PM -0400, Joe Perches wrote:
> > On Tue, 2010-10-19 at 20:29 -0700, Guenter Roeck wrote:
> > > There are several lines longer than 80 characters.
> > > Does this rule no longer apply ?
> > 80 columns isn't checked for printk format strings.
> Interesting.
> > A kernel general preference may be to keep formats as
> > a single string without line breaks so that grep works
> > better.
> > > Oddly enough, there are only four checkpatch warnings about long lines,
> > > even though there are many more.
> > The version I use doesn't show any warnings.
> checkpatch.pl from both v2.6.36-rc7 and v2.6.36-rc6 do report warnings.
> Looks like those versions flag long lines for pr_warn. Is your version
> older or newer ?

Newer.  It adds pr_warn to the exempted list, not just pr_warning.

> Anyway, would it be possible to split the patch into one patch per file ?

Oh sure.  It's trivial to do that.

> I don't know how Jean thinks about it, but in my opinion it would be cleaner,
> permit revert on a single patch/file instead of having to revert the entire series,
> it would simplify review, and it would make it much easier to cherry-pick 
> pieces into other releases if needed.

Jean, do you have a preference?
I'll resubmit if you want it separated.


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply

* Re: [PATCH v3 02/11] memcg: document cgroup dirty memory interfaces
From: KAMEZAWA Hiroyuki @ 2010-10-20  4:06 UTC (permalink / raw)
  To: Greg Thelen
  Cc: Daisuke Nishimura, Andrew Morton, linux-kernel, linux-mm,
	containers, Andrea Righi, Balbir Singh, Minchan Kim, Ciju Rajan K,
	David Rientjes
In-Reply-To: <xr93r5fl1poc.fsf@ninji.mtv.corp.google.com>

On Tue, 19 Oct 2010 17:45:08 -0700
Greg Thelen <gthelen@google.com> wrote:

> KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> writes:
> > BTW, how about supporing dirty_limit_in_bytes when use_hierarchy=0 or
> > leave it as broken when use_hierarchy=1 ?  It seems we can only
> > support dirty_ratio when hierarchy is used.
> 
> I am not sure what you mean here.

When using dirty_ratio, we can check the value of dirty_ratio at setting it
and make guarantee that any children's dirty_ratio cannot exceeds it parent's.

If we guarantee that, we can keep dirty_ratio even under hierarchy.

When it comes to dirty_limit_in_bytes, we never able to do such kind of
controls. So, it will be broken and will do different behavior than
dirty_ratio.

So, not supporing dirty_bytes when use_hierarchy==1 for now sounds reasonable to me.

Thanks,
-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

* Hauppauge WinTV PVR USB2 problems
From: Jim Peters @ 2010-10-20  4:04 UTC (permalink / raw)
  To: linux-media

I have 4 of these tuners, 3 of them are the 24xx series and 1 is a 29xx 
series, at one time they all worked great and I am not sure what happened to 
cause this but at some point the 29xx tuner started outputting black and white 
video. At first I suspected a hardware failure and thought maybe it was in the 
analog tuner part of the card so I switched it over to using the composite 
side but this didn't help. As a last resort to chalking it up as a failed 
piece of hardware I tried it on a windows machine and it works fine there so I 
am under the impression that this must be a driver/firmware issue. Since my 
other 3 tuners don't have a problem I assume that there must be some part of 
the driver/firmware that only affects the 29xx series cards and the problem lies 
within this, I have no idea where to look for a solution, any help would be 
appreciated.

^ permalink raw reply

* Re: [Qemu-devel] Re: Git server hung
From: Roy Tam @ 2010-10-20  4:02 UTC (permalink / raw)
  To: Michael Crawford; +Cc: qemu-devel
In-Reply-To: <AANLkTi=t7JCAg6iG6-xtTMAbiUj3XMw-mHFp9F_KGfej@mail.gmail.com>

Hi Michael,

Workaround: get from savannah. This one should work.
git://git.savannah.nongnu.org/qemu.git

Best regards,
Roy

2010/10/20 Michael Crawford <mdcrawford@gmail.com>:
>> git clone http://git.qemu.org/qemu.git
>>
>> This initializes a repository in qemu/.git and starts downloading from
>> the git server.
>>
>> After 60 or 70 mb - as seen via "du -s" it stops downloading.  The
>> "git clone" never completes.
>
> After a long time I got the following.  Perhaps someone had a commit
> in progress?
>
> error: Recv failure: Connection timed out (curl_result = 56, http_code
> = 0, sha1 = 61ca9c42095a78cd81f28a2b18da4993b12be128)
> error: Unable to find ac82067acb19f88ccf451b0fd37bfb9d4b7d03e9 under
> http://git.qemu.org/qemu.git
> Cannot obtain needed blob ac82067acb19f88ccf451b0fd37bfb9d4b7d03e9
> while processing commit fc29df759e7499446220349809a920ed2dfbc466.
> error: Fetch failed.
>
> Mike
>
>
>
> --
> Michael David Crawford
> mdcrawford at gmail dot com
>
>    GoingWare's Bag of Programming Tricks
>       http://www.goingware.com/tips/
>
>

^ permalink raw reply

* Re: [PATCH 11/25] ASoC: Samsung: Add common I2S driver
From: Mark Brown @ 2010-10-20  4:01 UTC (permalink / raw)
  To: Jassi Brar
  Cc: alsa-devel, kgene.kim, Jassi Brar, ben-linux, june.bae, lrg,
	sw.youn
In-Reply-To: <AANLkTi=5i=51=-m3ZhbTOWyQKz8H3oam6V=QfjL1DxhM@mail.gmail.com>

On Wed, Oct 20, 2010 at 12:27:43PM +0900, Jassi Brar wrote:
> On Wed, Oct 20, 2010 at 12:13 PM, Mark Brown

> > If we have something in the driver data struct specifying the masks to
> > use then set these at probe time rather than having the if statements -
> > probably the same mask can be used for playback & record if the
> > bitfields are lined up similarly.  This would then be:

> >        con |= data->active_mask;
> >        con &= ~data->pause_mask;

> > or similar, possibly with some shifts.

> Let me see if the space saved is worth the complication.

I was thinking it should make something similar by making it clear that
we're just doing the same thing to a different location rather than lots
of conditional code to follow.

> > Please add a comment explaining that you're inverting the orientation
> > you set previously - it's really surprising when reading the code.

> Ok, I'll add a comment.
> Btw, isn't it the standard way? Don't other I2S CPU drivers do the same thing ?

Not commonly - normally people don't implement anything except plain I2S
mode, or have explict mode and inversion bits (so the mode sets the
expected polarity and then the inversion bit swaps that).

> > How would the index be used with multi-component?

> For example, please look at [Patch 23/25]

> +               /* Secondary is at offset MAX_I2S from Primary */
> +               str = (char *)smdk_dai[SEC_PLAYBACK].cpu_dai_name;
> +               str[strlen(str) - 1] = '0' + MAX_I2S;

Hrm, slightly fiddly.  Perhaps we want a function people can call which
will generate the secondary DAI name for you?  Might be more directly
what people want.

^ permalink raw reply

* Re: [PATCH v3 02/11] memcg: document cgroup dirty memory interfaces
From: Greg Thelen @ 2010-10-20  0:45 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: Daisuke Nishimura, Andrew Morton, linux-kernel, linux-mm,
	containers, Andrea Righi, Balbir Singh, Minchan Kim, Ciju Rajan K,
	David Rientjes
In-Reply-To: <20101020091109.ccd7b39a.kamezawa.hiroyu@jp.fujitsu.com>

KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> writes:

> On Tue, 19 Oct 2010 14:00:58 -0700
> Greg Thelen <gthelen@google.com> wrote:
>
>> Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> writes:
>> 
>> > On Mon, 18 Oct 2010 17:39:35 -0700
>> > Greg Thelen <gthelen@google.com> wrote:
>> >
>> >> Document cgroup dirty memory interfaces and statistics.
>> >> 
>> >> Signed-off-by: Andrea Righi <arighi@develer.com>
>> >> Signed-off-by: Greg Thelen <gthelen@google.com>
>> >> ---
>> >> 
>> >> Changelog since v1:
>> >> - Renamed "nfs"/"total_nfs" to "nfs_unstable"/"total_nfs_unstable" in per cgroup
>> >>   memory.stat to match /proc/meminfo.
>> >> 
>> >> - Allow [kKmMgG] suffixes for newly created dirty limit value cgroupfs files.
>> >> 
>> >> - Describe a situation where a cgroup can exceed its dirty limit.
>> >> 
>> >>  Documentation/cgroups/memory.txt |   60 ++++++++++++++++++++++++++++++++++++++
>> >>  1 files changed, 60 insertions(+), 0 deletions(-)
>> >> 
>> >> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>> >> index 7781857..02bbd6f 100644
>> >> --- a/Documentation/cgroups/memory.txt
>> >> +++ b/Documentation/cgroups/memory.txt
>> >> @@ -385,6 +385,10 @@ mapped_file	- # of bytes of mapped file (includes tmpfs/shmem)
>> >>  pgpgin		- # of pages paged in (equivalent to # of charging events).
>> >>  pgpgout		- # of pages paged out (equivalent to # of uncharging events).
>> >>  swap		- # of bytes of swap usage
>> >> +dirty		- # of bytes that are waiting to get written back to the disk.
>> >> +writeback	- # of bytes that are actively being written back to the disk.
>> >> +nfs_unstable	- # of bytes sent to the NFS server, but not yet committed to
>> >> +		the actual storage.
>> >>  inactive_anon	- # of bytes of anonymous memory and swap cache memory on
>> >>  		LRU list.
>> >>  active_anon	- # of bytes of anonymous and swap cache memory on active
>> >
>> > Shouldn't we add description of "total_diryt/writeback/nfs_unstable" too ?
>> > Seeing [5/11], it will be showed in memory.stat.
>> 
>> Good catch.  See patch (below).
>> 
>> >> @@ -453,6 +457,62 @@ memory under it will be reclaimed.
>> >>  You can reset failcnt by writing 0 to failcnt file.
>> >>  # echo 0 > .../memory.failcnt
>> >>  
>> >> +5.5 dirty memory
>> >> +
>> >> +Control the maximum amount of dirty pages a cgroup can have at any given time.
>> >> +
>> >> +Limiting dirty memory is like fixing the max amount of dirty (hard to reclaim)
>> >> +page cache used by a cgroup.  So, in case of multiple cgroup writers, they will
>> >> +not be able to consume more than their designated share of dirty pages and will
>> >> +be forced to perform write-out if they cross that limit.
>> >> +
>> >> +The interface is equivalent to the procfs interface: /proc/sys/vm/dirty_*.  It
>> >> +is possible to configure a limit to trigger both a direct writeback or a
>> >> +background writeback performed by per-bdi flusher threads.  The root cgroup
>> >> +memory.dirty_* control files are read-only and match the contents of
>> >> +the /proc/sys/vm/dirty_* files.
>> >> +
>> >> +Per-cgroup dirty limits can be set using the following files in the cgroupfs:
>> >> +
>> >> +- memory.dirty_ratio: the amount of dirty memory (expressed as a percentage of
>> >> +  cgroup memory) at which a process generating dirty pages will itself start
>> >> +  writing out dirty data.
>> >> +
>> >> +- memory.dirty_limit_in_bytes: the amount of dirty memory (expressed in bytes)
>> >> +  in the cgroup at which a process generating dirty pages will start itself
>> >> +  writing out dirty data.  Suffix (k, K, m, M, g, or G) can be used to indicate
>> >> +  that value is kilo, mega or gigabytes.
>> >> +
>> >> +  Note: memory.dirty_limit_in_bytes is the counterpart of memory.dirty_ratio.
>> >> +  Only one of them may be specified at a time.  When one is written it is
>> >> +  immediately taken into account to evaluate the dirty memory limits and the
>> >> +  other appears as 0 when read.
>> >> +
>> >> +- memory.dirty_background_ratio: the amount of dirty memory of the cgroup
>> >> +  (expressed as a percentage of cgroup memory) at which background writeback
>> >> +  kernel threads will start writing out dirty data.
>> >> +
>> >> +- memory.dirty_background_limit_in_bytes: the amount of dirty memory (expressed
>> >> +  in bytes) in the cgroup at which background writeback kernel threads will
>> >> +  start writing out dirty data.  Suffix (k, K, m, M, g, or G) can be used to
>> >> +  indicate that value is kilo, mega or gigabytes.
>> >> +
>> >> +  Note: memory.dirty_background_limit_in_bytes is the counterpart of
>> >> +  memory.dirty_background_ratio.  Only one of them may be specified at a time.
>> >> +  When one is written it is immediately taken into account to evaluate the dirty
>> >> +  memory limits and the other appears as 0 when read.
>> >> +
>> >> +A cgroup may contain more dirty memory than its dirty limit.  This is possible
>> >> +because of the principle that the first cgroup to touch a page is charged for
>> >> +it.  Subsequent page counting events (dirty, writeback, nfs_unstable) are also
>> >> +counted to the originally charged cgroup.
>> >> +
>> >> +Example: If page is allocated by a cgroup A task, then the page is charged to
>> >> +cgroup A.  If the page is later dirtied by a task in cgroup B, then the cgroup A
>> >> +dirty count will be incremented.  If cgroup A is over its dirty limit but cgroup
>> >> +B is not, then dirtying a cgroup A page from a cgroup B task may push cgroup A
>> >> +over its dirty limit without throttling the dirtying cgroup B task.
>> >> +
>> >>  6. Hierarchy support
>> >>  
>> >>  The memory controller supports a deep hierarchy and hierarchical accounting.
>> >> -- 
>> >> 1.7.1
>> >> 
>> > Can you clarify whether we can limit the "total" dirty pages under hierarchy
>> > in use_hierarchy==1 case ?
>> > If we can, I think it would be better to note it in this documentation.
>> >
>> >
>> > Thanks,
>> > Daisuke Nishimura.
>> 
>> Here is a second version of this -v3 doc patch:
>> 
>> Author: Greg Thelen <gthelen@google.com>
>> Date:   Sat Apr 10 15:34:28 2010 -0700
>> 
>>     memcg: document cgroup dirty memory interfaces
>>     
>>     Document cgroup dirty memory interfaces and statistics.
>>     
>>     Signed-off-by: Andrea Righi <arighi@develer.com>
>>     Signed-off-by: Greg Thelen <gthelen@google.com>
>> 
>
> nitpicks. and again, why you always drop Acks ?

I dropped acks because the patch changed and I did not want to assume
that it was still acceptable.  Is this incorrect protocol?

>> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>> index 7781857..8bf6d3b 100644
>> --- a/Documentation/cgroups/memory.txt
>> +++ b/Documentation/cgroups/memory.txt
>> @@ -385,6 +385,10 @@ mapped_file	- # of bytes of mapped file (includes tmpfs/shmem)
>>  pgpgin		- # of pages paged in (equivalent to # of charging events).
>>  pgpgout		- # of pages paged out (equivalent to # of uncharging events).
>>  swap		- # of bytes of swap usage
>> +dirty		- # of bytes that are waiting to get written back to the disk.
>
> extra tab ?

There is no extra tab here.  It's a display artifact.  When the patch is
applied the columns line up.

>> +writeback	- # of bytes that are actively being written back to the disk.
>> +nfs_unstable	- # of bytes sent to the NFS server, but not yet committed to
>> +		the actual storage.
>>  inactive_anon	- # of bytes of anonymous memory and swap cache memory on
>>  		LRU list.
>>  active_anon	- # of bytes of anonymous and swap cache memory on active
>> @@ -406,6 +410,9 @@ total_mapped_file	- sum of all children's "cache"
>>  total_pgpgin		- sum of all children's "pgpgin"
>>  total_pgpgout		- sum of all children's "pgpgout"
>>  total_swap		- sum of all children's "swap"
>> +total_dirty		- sum of all children's "dirty"
>> +total_writeback		- sum of all children's "writeback"
>
> here, too.

There is no extra tab here.  It's a display artifact.  When the patch is
applied the columns line up.

>> +total_nfs_unstable	- sum of all children's "nfs_unstable"
>>  total_inactive_anon	- sum of all children's "inactive_anon"
>>  total_active_anon	- sum of all children's "active_anon"
>>  total_inactive_file	- sum of all children's "inactive_file"
>> @@ -453,6 +460,71 @@ memory under it will be reclaimed.
>>  You can reset failcnt by writing 0 to failcnt file.
>>  # echo 0 > .../memory.failcnt
>>  
>> +5.5 dirty memory
>> +
>> +Control the maximum amount of dirty pages a cgroup can have at any given time.
>> +
>> +Limiting dirty memory is like fixing the max amount of dirty (hard to reclaim)
>> +page cache used by a cgroup.  So, in case of multiple cgroup writers, they will
>> +not be able to consume more than their designated share of dirty pages and will
>> +be forced to perform write-out if they cross that limit.
>> +
>> +The interface is equivalent to the procfs interface: /proc/sys/vm/dirty_*.  It
>> +is possible to configure a limit to trigger both a direct writeback or a
>> +background writeback performed by per-bdi flusher threads.  The root cgroup
>> +memory.dirty_* control files are read-only and match the contents of
>> +the /proc/sys/vm/dirty_* files.
>> +
>> +Per-cgroup dirty limits can be set using the following files in the cgroupfs:
>> +
>> +- memory.dirty_ratio: the amount of dirty memory (expressed as a percentage of
>> +  cgroup memory) at which a process generating dirty pages will itself start
>> +  writing out dirty data.
>> +
>> +- memory.dirty_limit_in_bytes: the amount of dirty memory (expressed in bytes)
>> +  in the cgroup at which a process generating dirty pages will start itself
>> +  writing out dirty data.  Suffix (k, K, m, M, g, or G) can be used to indicate
>> +  that value is kilo, mega or gigabytes.
>> +
>> +  Note: memory.dirty_limit_in_bytes is the counterpart of memory.dirty_ratio.
>> +  Only one of them may be specified at a time.  When one is written it is
>> +  immediately taken into account to evaluate the dirty memory limits and the
>> +  other appears as 0 when read.
>> +
>> +- memory.dirty_background_ratio: the amount of dirty memory of the cgroup
>> +  (expressed as a percentage of cgroup memory) at which background writeback
>> +  kernel threads will start writing out dirty data.
>> +
>> +- memory.dirty_background_limit_in_bytes: the amount of dirty memory (expressed
>> +  in bytes) in the cgroup at which background writeback kernel threads will
>> +  start writing out dirty data.  Suffix (k, K, m, M, g, or G) can be used to
>> +  indicate that value is kilo, mega or gigabytes.
>> +
>> +  Note: memory.dirty_background_limit_in_bytes is the counterpart of
>> +  memory.dirty_background_ratio.  Only one of them may be specified at a time.
>> +  When one is written it is immediately taken into account to evaluate the dirty
>> +  memory limits and the other appears as 0 when read.
>> +
>> +A cgroup may contain more dirty memory than its dirty limit.  This is possible
>> +because of the principle that the first cgroup to touch a page is charged for
>> +it.  Subsequent page counting events (dirty, writeback, nfs_unstable) are also
>> +counted to the originally charged cgroup.
>> +
>> +Example: If page is allocated by a cgroup A task, then the page is charged to
>> +cgroup A.  If the page is later dirtied by a task in cgroup B, then the cgroup A
>> +dirty count will be incremented.  If cgroup A is over its dirty limit but cgroup
>> +B is not, then dirtying a cgroup A page from a cgroup B task may push cgroup A
>> +over its dirty limit without throttling the dirtying cgroup B task.
>> +
>> +When use_hierarchy=0, each cgroup has independent dirty memory usage and limits.
>> +
>> +When use_hierarchy=1, a parent cgroup increasing its dirty memory usage will
>> +compare its total_dirty memory (which includes sum of all child cgroup dirty
>> +memory) to its dirty limits.  This keeps a parent from explicitly exceeding its
>> +dirty limits.  However, a child cgroup can increase its dirty usage without
>> +considering the parent's dirty limits.  Thus the parent's total_dirty can exceed
>> +the parent's dirty limits as a child dirties pages.
>
> Hmm. in short, dirty_ratio in use_hierarchy=1 doesn't work as an user
> expects.  Is this a spec. or a current implementation ?

This limitation is due to the current implementation.  I agree that it
is not perfect.  We could extend the page-writeback.c changes, PATCH
11/11 ( http://marc.info/?l=linux-mm&m=128744907030215 ), to also check
the dirty limit of each parent in the memcg hierarchy.  This would walk
up the tree until root or a cgroup with use_hierarchy=0 is found.
Alternatively, we could provide this functionality in a later patch
series.  The changes to page-writeback.c may be significant.

> I think as following.
>  - add a limitation as "At setting chidlren's dirty_ratio, it must be
>    below parent's.  If it exceeds parent's dirty_ratio, EINVAL is
>    returned."
>
> Could you modify setting memory.dirty_ratio code ?

I assume we are only talking about the use_hierarchy=1 case.  What if
the parent ratio is changed?  If we want to ensure that child ratios are
never larger than parent, then the code must check every child cgroup to
ensure that each child ratio is <= the new parent ratio.  Correct?

Even if we manage to prevent all child ratios from exceeding parent
ratios, we still have the problem of the sum of child ratios may exceed
parent.  Example:
         A (10%)
   B (10%)   C (10%)

There would be nothing to prevent A,B,C dirty ratios from all being set
to 10% as shown.  The current implementation would allow for B and C to
reach 10% thereby pushing the A to 20%.  We could require that each
child dirty limit must fit within parent dirty limit.  So (B+C<=A).
This would allow for:

        A (10%)
   B (7%)   C (3%)

If we had this 10/7/3 limiting code, which statically partitions dirty
memory usage, then we would not needed to walk up the memcg tree
checking each parent.  This nice because it allows us to only
complicates the setting of dirty limits, which is not part of the
performance path.  However, being static partitioning has limitations.
If the system has a dirty ratio of 50% and we create 100 cgroups with
equal dirty limits, the dirty limits for each memcg would be 0.5%.

> Then, parent's dirty_ratio will never exceeds its own. (If I
> understand correctly.)
>
> "memory.dirty_limit_in_bytes" will be a bit more complecated, but I
> think you can.
>
>
> Thanks,
> -Kame

KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> writes:
> I'd like to consider a patch.  Please mention that "use_hierarchy=1
> case depends on implemenation." for now.

I will clarify the current implementation behavior in the documentation.
A later patch series can change the use_hierarchy=1 behavior.


KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> writes:
> BTW, how about supporing dirty_limit_in_bytes when use_hierarchy=0 or
> leave it as broken when use_hierarchy=1 ?  It seems we can only
> support dirty_ratio when hierarchy is used.

I am not sure what you mean here.  Are you suggesting that we prohibit
usage of dirty limits/ratios when use_hierarchy=1?  This is appealing
because it does not expose the user to unexpected behavior.  Only the
well supported case would be configurable.

^ permalink raw reply

* Re: Call for help for demo UPNP media renderer
From: Xu, Dongxiao @ 2010-10-20  3:58 UTC (permalink / raw)
  To: Xu, Dongxiao, Zanussi, Tom; +Cc: yocto@yoctoproject.org
In-Reply-To: <D5AB6E638E5A3E4B8F4406B113A5A19A2FF0D144@shsmsx501.ccr.corp.intel.com>

I just built out the poky-image-rygel image with your meta-demo layer, and run 

rygel --gst-debug-level=5 

I still saw it "segmentation fault" in the last...

I am looking into it.

Thanks,
Dongxiao

Xu, Dongxiao wrote:
> Zanussi, Tom wrote:
>> On Tue, 2010-10-19 at 17:40 -0700, Xu, Dongxiao wrote:
>>> Joshua Lock wrote:
>>>> On Wed, 2010-10-20 at 01:04 +0100, Joshua Lock wrote:
>>>>> On Tue, 2010-10-19 at 14:31 -0700, Saul Wold wrote:
>>>>>> 
>>>>>> Dongxiao,
>>>>>> 
>>>>>> Can you take a look at this since you have worked with the
>>>>>> gstreamer?
>>>>> 
>>>>> I did a sloppy job pushing my changes when leaving the office but
>>>>> think I have replicated most/all of the in the josh/demo branch.
>>>>> 
>>>>> I also took a look through the rygel code to see what gstreamer
>>>>> elements are explicitly being used, I've created a list and tried
>>>>> to ensure as many as possible of them are in the IMAGE_INSTALL
>>>>> list for poky-image-rygel, adding them to the RDEPENDS for rygel
>>>>> doesn't appear to have included them in the image I just
>>>>> created... 
>>>>> 
>>>>> Full list of names of pipeline elements I found in the rygel code
>>>>> follows: 
>>>>> 
>>>>> decodebin2, videorate, videoscale, ffmpegcolorspace, ffenc_wmv1,
>>>>> twolame, lame, mp3parse, ffenc_wmav2, convert-sink-pad,
>>>>> ffenc_mpeg2video, audio-src-pad, audio-sink-pad,
>>>>> audio-enc-sink-pad, sink, mpegtsmux, audioconvert, audioresample,
>>>>> audiorate, capsfilter, audiotestsrc, videotestsrc, ffmux_asf
>>>>> 
>>>> 
>>>> The image I just built with my latest changes in josh/demo
>>>> worked!?! Rygel did not segfault :-) 
>>>> 
>>>> If you have time Dongxiao (or anyone else) I'd appreciate if you
>>>> could double-check my changes (my install_append in rygel to create
>>>> a .config isn't working, so you'll need to do that manually and run
>>>> rygel-preferences to disable the tracker plugin). If you could test
>>>> using Rygel as a renderer for some content served by the mediatomb
>>>> image, that would be much appreciated. You'll want gupnp-av-cp as
>>>> provided by gupnp-tools to control the renderer and content server.
>>>> 
>>>> Thanks,
>>>> Joshua
>>> 
>>> I will try your branch, however I didn't find josh/demo in
>>> poky-contrib. Is it reside in other place?
>>> 
>> 
>> It should be here:
>> 
>> ssh://git@git.pokylinux.org/meta-demo.git
>> 
>> Tom
> 
> Got it, thanks!
> 
> Dongxiao
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.pokylinux.org/listinfo/yocto



^ permalink raw reply

* RE: [RFC v3][PATCH 0/4] OMAP: DSS2: Overlay Manager LCD2 support in DISPC
From: Taneja, Archit @ 2010-10-20  3:56 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap@vger.kernel.org
In-Reply-To: <1287493790.2216.26.camel@tubuntu>

Hi,

Tomi Valkeinen wrote:
> Hi,
> 
> On Tue, 2010-10-05 at 13:55 +0200, ext Archit Taneja wrote:
>> This patch series which incorporates changes in DSS2 to enable
>> omap_dss_device instances to use the new Overlay Manager LCD2 in DISPC.
>> 
>> On OMAP4, we have a new DISPC channel for Overlay Manager LCD2. This
>> channel's video port is a source port for RFBI, DSI2 and DPI. The
>> Primary channel's video port is connected to RFBI and DSI1.
>> 
>> There is a set of regsiters for LCD2 channel similar to the existing
>> LCD channel, like DISPC_CONTROL2, DISPC_DIVISOR2, DISPC_CONFIG2 and so on.
>> 
>> In order to decide which LCD Overlay Manager to configure(LCD/LCD2),
>> there is a need for the omap_dss_device instances to tell the
>> interface drivers(DSI, DPI, RFBI etc) which LCD channel they want to
>> connect to, so that the corresponding registers get configured.
>> Therefore, a new enum omap_channel member is introduced to omap_dss_device.
>> 
>> This design was made keeping in mind the possible addition of more
>> Overlay Managers in future OMAPs, this code is also backward
>> compatible with OMAP3 as omap_dss_device instances in OMAP3 will stick
>> only with OMAP_DSS_CHANNEL_LCD.
>> 
>> This will apply over the set of dss_feature framework patches:
>> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34768.html
> 
> The patchset makes dispc API changes in patch 2, but doesn't
> change any of the code that uses that API. This means that
> the kernel doesn't compile after applying patch 2.
> 
> The kernel has to be compilable and working after each patch, so that is not
> acceptable. 
> 
> Fixing that in easy way would mean squashing the later
> patches together with patch 2, but that would result in a
> huge patch, and patch 2 is already very big. Thus I'd suggest
> doing the changes in smaller bits.
> 
> You could first add the register definitions, and make the
> changes in dispc.c to keep everything working. After that you
> could change the dispc functions, one by one or in small
> groups (depending on the amount of changes), and add the
> channel argument and adjusting the code using those functions in the same
> time. 
> 
> This would solve the problem of keeping the kernel working,
> and would make the patches much more readable.

Thanks, will take care of this.

Archit

^ 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.