diff options
author | Joshua Lock <joshua.g.lock@intel.com> | 2016-08-01 12:00:26 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-04 15:22:21 +0100 |
commit | 2726f91d410e66efd2c345b6db60bac3e0b592aa (patch) | |
tree | ac7a00273177a50eb4eb8e71e6904e9f300baa5d /meta/recipes-devtools/pseudo/files | |
parent | d4040da8bc23e6c289cc8f2ca6d43deb06acf7d6 (diff) | |
download | poky-2726f91d410e66efd2c345b6db60bac3e0b592aa.tar.gz |
pseudo: backport patch to fix xattr performance
In the 1.8 series of pseudo extended attribute handling was reworked
to be a property of inodes, not paths, and as a product fixed extended
attribute semantics on hardlinks. Unfortunately this rework introduced
a slow path around file deletion.
Add a patch for use by the pseudo 1.8.1 recipe which backports a fix
for this regression from the master branch of pseudo.
[YOCTO #9929]
(From OE-Core rev: 75627af164f027de0036b91854e9b926de786bcd)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/pseudo/files')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch b/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch new file mode 100644 index 0000000000..4e072e6c40 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch | |||
@@ -0,0 +1,117 @@ | |||
1 | From 0d9071f3090bbd7880558f3b488b236ac19b44fc Mon Sep 17 00:00:00 2001 | ||
2 | From: seebs <seebs@seebs.net> | ||
3 | Date: Thu, 28 Jul 2016 14:02:12 -0500 | ||
4 | Subject: [PATCH 1/2] Fix xattr performance | ||
5 | |||
6 | When deleting files, we *do* know the inode and attribute, most of the | ||
7 | time, so we pass those in whenever possible. The full purge of unmatched | ||
8 | xattrs should not happen when the correct dev/ino are believed to be known. | ||
9 | |||
10 | Signed-off-by: Seebs <seebs@seebs.net> | ||
11 | |||
12 | [YOCTO #9929] | ||
13 | Upstream-Status: Backport (0d9071f3090bbd7880558f3b488b236ac19b44fc) | ||
14 | Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> | ||
15 | --- | ||
16 | ChangeLog.txt | 3 +++ | ||
17 | pseudo.c | 11 ++++++++--- | ||
18 | pseudo_db.c | 15 +++++++++------ | ||
19 | pseudo_db.h | 2 +- | ||
20 | 4 files changed, 21 insertions(+), 10 deletions(-) | ||
21 | |||
22 | diff --git a/ChangeLog.txt b/ChangeLog.txt | ||
23 | index 131f163..d6359ca 100644 | ||
24 | --- a/ChangeLog.txt | ||
25 | +++ b/ChangeLog.txt | ||
26 | @@ -1,3 +1,6 @@ | ||
27 | +2016-07-28: | ||
28 | + * (seebs) Fix performance issue on deletion with xattr changes. | ||
29 | + | ||
30 | 2016-07-08: | ||
31 | * (RP) release 1.8.1 | ||
32 | * (joshuagl) Fix log table creation issue | ||
33 | diff --git a/pseudo.c b/pseudo.c | ||
34 | index 52f649f..db1c400 100644 | ||
35 | --- a/pseudo.c | ||
36 | +++ b/pseudo.c | ||
37 | @@ -600,7 +600,12 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon | ||
38 | if (by_path.deleting != 0) { | ||
39 | pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n", | ||
40 | msg->path); | ||
41 | - pdb_did_unlink_file(msg->path, by_path.deleting); | ||
42 | + /* in this case, we don't trust the | ||
43 | + * existing entries, so we will do the | ||
44 | + * more expensive sweep for stray | ||
45 | + * xattrs. | ||
46 | + */ | ||
47 | + pdb_did_unlink_file(msg->path, NULL, by_path.deleting); | ||
48 | } else { | ||
49 | pseudo_diag("inode mismatch: '%s' ino %llu in db, %llu in request.\n", | ||
50 | msg->path, | ||
51 | @@ -698,7 +703,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon | ||
52 | if (by_ino.deleting != 0) { | ||
53 | pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n", | ||
54 | msg->path); | ||
55 | - pdb_did_unlink_file(path_by_ino, by_ino.deleting); | ||
56 | + pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting); | ||
57 | } else { | ||
58 | pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n", | ||
59 | msg->nlink, | ||
60 | @@ -930,7 +935,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon | ||
61 | } | ||
62 | break; | ||
63 | case OP_DID_UNLINK: | ||
64 | - pdb_did_unlink_file(msg->path, msg->client); | ||
65 | + pdb_did_unlink_file(msg->path, msg, msg->client); | ||
66 | break; | ||
67 | case OP_CANCEL_UNLINK: | ||
68 | pdb_cancel_unlink_file(msg); | ||
69 | diff --git a/pseudo_db.c b/pseudo_db.c | ||
70 | index 289bb29..e7dd193 100644 | ||
71 | --- a/pseudo_db.c | ||
72 | +++ b/pseudo_db.c | ||
73 | @@ -1848,7 +1848,7 @@ pdb_did_unlink_files(int deleting) { | ||
74 | |||
75 | /* confirm deletion of a specific file by a given client */ | ||
76 | int | ||
77 | -pdb_did_unlink_file(char *path, int deleting) { | ||
78 | +pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting) { | ||
79 | static sqlite3_stmt *delete_exact; | ||
80 | int rc, exact; | ||
81 | char *sql_delete_exact = "DELETE FROM files WHERE path = ? AND deleting = ?;"; | ||
82 | @@ -1878,11 +1878,14 @@ pdb_did_unlink_file(char *path, int deleting) { | ||
83 | exact = sqlite3_changes(file_db); | ||
84 | pseudo_debug(PDBGF_DB, "(exact %d)\n", exact); | ||
85 | sqlite3_reset(delete_exact); | ||
86 | - sqlite3_clear_bindings(delete_exact); | ||
87 | - /* we have to clean everything because we don't know for sure the | ||
88 | - * device/inode... | ||
89 | - */ | ||
90 | - pdb_clear_unused_xattrs(); | ||
91 | + if (msg) { | ||
92 | + pdb_clear_xattrs(msg); | ||
93 | + } else { | ||
94 | + /* we have to clean everything because we don't know for sure the | ||
95 | + * device/inode... | ||
96 | + */ | ||
97 | + pdb_clear_unused_xattrs(); | ||
98 | + } | ||
99 | return rc != SQLITE_DONE; | ||
100 | } | ||
101 | |||
102 | diff --git a/pseudo_db.h b/pseudo_db.h | ||
103 | index a54f3c1..1b2599c 100644 | ||
104 | --- a/pseudo_db.h | ||
105 | +++ b/pseudo_db.h | ||
106 | @@ -39,7 +39,7 @@ typedef struct { | ||
107 | |||
108 | extern int pdb_maybe_backup(void); | ||
109 | extern int pdb_cancel_unlink_file(pseudo_msg_t *msg); | ||
110 | -extern int pdb_did_unlink_file(char *path, int deleting); | ||
111 | +extern int pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting); | ||
112 | extern int pdb_did_unlink_files(int deleting); | ||
113 | extern int pdb_link_file(pseudo_msg_t *msg); | ||
114 | extern int pdb_may_unlink_file(pseudo_msg_t *msg, int deleting); | ||
115 | -- | ||
116 | 2.7.4 | ||
117 | |||