You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
(66) |
Jul
(102) |
Aug
(78) |
Sep
(106) |
Oct
(137) |
Nov
(147) |
Dec
(147) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(71) |
Feb
(139) |
Mar
(86) |
Apr
(76) |
May
(57) |
Jun
(10) |
Jul
(12) |
Aug
(6) |
Sep
(8) |
Oct
(12) |
Nov
(12) |
Dec
(18) |
| 2011 |
Jan
(16) |
Feb
(19) |
Mar
(3) |
Apr
(1) |
May
(16) |
Jun
(17) |
Jul
(74) |
Aug
(22) |
Sep
(18) |
Oct
(24) |
Nov
(21) |
Dec
(30) |
| 2012 |
Jan
(31) |
Feb
(16) |
Mar
(22) |
Apr
(25) |
May
(18) |
Jun
(13) |
Jul
(83) |
Aug
(49) |
Sep
(20) |
Oct
(60) |
Nov
(35) |
Dec
(28) |
| 2013 |
Jan
(39) |
Feb
(61) |
Mar
(35) |
Apr
(21) |
May
(45) |
Jun
(56) |
Jul
(20) |
Aug
(9) |
Sep
(10) |
Oct
(31) |
Nov
(8) |
Dec
(4) |
| 2014 |
Jan
(6) |
Feb
(7) |
Mar
(7) |
Apr
(6) |
May
(4) |
Jun
(8) |
Jul
(5) |
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
(11) |
Dec
(5) |
| 2015 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(4) |
May
(9) |
Jun
(4) |
Jul
(15) |
Aug
(8) |
Sep
(16) |
Oct
(18) |
Nov
(15) |
Dec
(7) |
| 2016 |
Jan
(20) |
Feb
(9) |
Mar
(15) |
Apr
(24) |
May
(16) |
Jun
(28) |
Jul
(22) |
Aug
(23) |
Sep
(18) |
Oct
(30) |
Nov
(40) |
Dec
(9) |
| 2017 |
Jan
(1) |
Feb
(8) |
Mar
(37) |
Apr
(26) |
May
(25) |
Jun
(46) |
Jul
(24) |
Aug
(9) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Don Z. <dz...@re...> - 2012-07-05 13:20:51
|
On Tue, Jul 03, 2012 at 11:33:57PM +0000, Seiji Aguchi wrote: > [Problem] > Current efi_pstore simply overwrites existing entries in NVRAM. > So, if 2nd panic happens before a user checks 1st panic message, 1st panic message will be lost. I thought the rule was entries do not get overwritten until they are deleted first. Perhaps that is just an APEI thing, but it seems like that should be a good rule for EFI too. Mainly because there is very little userspace apps that actually clear the old error records. So this could become a common problem. Unless we are implementing a flight recorder option which explicitly states overwrite older entries? Cheers, Don > > [Solution] > To avoid missing 1st panic message, this patch introduce a rule checking if existing entries in NRAM are erasable to efi_pstore. > > [Patch Descriptions] > > [PATCH 1/2] Duplicate a shared code between write and erase callbacks > > Currently, efi_pstore driver shares a code erasing existing entries in NVRAM with write and erase callbacks. > But there some cases we should avoid erasing existing entries in write callback. (Please see PATCH 2/2). > This patch duplicates the code so that write and erase callbacks work independently. > > > [PATCH 2/2] write callback: Check if existing entry is erasable > > this patch introduce a rule checking if existing entries in NRAM are erasable to efi_pstore. > With this patch, if previous event is panic, efi_pstore never overwrite it. > > > drivers/firmware/efivars.c | 94 +++++++++++++++++++++++++++++++++++++++++++- > fs/pstore/platform.c | 4 +- > include/linux/pstore.h | 5 ++ > 3 files changed, 99 insertions(+), 4 deletions(-) > > Seiji |
|
From: Don Z. <dz...@re...> - 2012-07-05 13:18:24
|
On Tue, Jul 03, 2012 at 11:34:58PM +0000, Seiji Aguchi wrote:
> This patch duplicates a code of erase callback shared with write callback so that they work independently.
Can you expand this changelog to explain why this is needed and what
problem you are trying to fix? I know you talked about it in the patch
series header, but the header doesn't get committed.
Cheers,
Don
>
> Signed-off-by: Seiji Aguchi <sei...@hd...>
> ---
> drivers/firmware/efivars.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 45 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 47408e8..4929254 100644
> --- a/drivers/firmware/efivars.c
> +++ b/drivers/firmware/efivars.c
> @@ -756,7 +756,51 @@ static int efi_pstore_write(enum pstore_type_id type, static int efi_pstore_erase(enum pstore_type_id type, u64 id,
> struct pstore_info *psi)
> {
> - efi_pstore_write(type, 0, &id, (unsigned int)id, 0, psi);
> + char stub_name[DUMP_NAME_LEN];
> + efi_char16_t efi_name[DUMP_NAME_LEN];
> + efi_guid_t vendor = LINUX_EFI_CRASH_GUID;
> + struct efivars *efivars = psi->data;
> + struct efivar_entry *entry, *found = NULL;
> + int i;
> +
> + sprintf(stub_name, "dump-type%u-%llu-", type, id);
> +
> + spin_lock(&efivars->lock);
> +
> + for (i = 0; i < DUMP_NAME_LEN; i++)
> + efi_name[i] = stub_name[i];
> +
> + /*
> + * Clean up any entries with the same name
> + */
> +
> + list_for_each_entry(entry, &efivars->list, list) {
> + get_var_data_locked(efivars, &entry->var);
> +
> + if (efi_guidcmp(entry->var.VendorGuid, vendor))
> + continue;
> + if (utf16_strncmp(entry->var.VariableName, efi_name,
> + utf16_strlen(efi_name)))
> + continue;
> + /* Needs to be a prefix */
> + if (entry->var.VariableName[utf16_strlen(efi_name)] == 0)
> + continue;
> +
> + /* found */
> + found = entry;
> + efivars->ops->set_variable(entry->var.VariableName,
> + &entry->var.VendorGuid,
> + PSTORE_EFI_ATTRIBUTES,
> + 0, NULL);
> + }
> +
> + if (found)
> + list_del(&found->list);
> +
> + spin_unlock(&efivars->lock);
> +
> + if (found)
> + efivar_unregister(found);
>
> return 0;
> }
> --
> 1.7.1
>
>
|
|
From: GlobalBono <of...@gl...> - 2012-07-04 07:31:31
|
Asegúrate de no perderte ninguna oferta, añade of...@gl... a tu lista de contactos. Si no ves correctamente las imágenes, pulsa aquí ( "http://www.globalbono.com/ofertas_espana/campaigns/preview/?id=62" ) Tus Ofertas de hoy Síguenos en: ( "http://es-es.facebook.com/GlobalBono" ) ( "https://twitter.com/#!/GlobalBono" ) 40% Dto. Lote de 24 tuppers Lote de 24 tuppers con su propio dispensador giratorio para que lo... 29,19€ ( "http://www.globalbono.com/barcelona/lote-de-24-tuppers.html" ) Antes 49,00€ Dto: 40% Ahorro: 19,81€ 31% Dto. Nepal y el Valle de Kathmandú, con Safari a Lomos de un Elefante Circuito de 5 noches en Nepal con guía de habla española recorrien... 1.195,00€ ( "http://www.globalbono.com/barcelona/nepal-y-el-valle-de-kathmandu-con-safari-a-lomos-de-un-elefante.html" ) Antes 1.735,00€ Dto: 31% Ahorro: 540,00€ 47% Dto. Termómetro Para Botellas Termómetro para botellas, sirve el vino siempre a la temperatura p... 15,51€ ( "http://www.globalbono.com/barcelona/termometro-para-botellas.html" ) Antes 29,00€ Dto: 47% Ahorro: 13,49€ 47% Dto. Pack de 3 Beauty Bra Pack de 3 Beauty Bra edición verano, para que puedas seguir lucien... 24,00€ ( "http://www.globalbono.com/barcelona/pack-de-3-beauty-bra.html" ) Antes 45,00€ Dto: 47% Ahorro: 21,00€ 52% Dto. Bombilla Led de 16 Colores. Bombilla led de 16 colores diferentes para que la iluminación pase... 21,41€ ( "http://www.globalbono.com/barcelona/bombilla-led-de-16-colores.html" ) Antes 45,00€ Dto: 52% Ahorro: 23,59€ 50% Dto. Aparato de Cardio Aparato para cardio con el que podrás quemar grasa y tonificar los... 124,84€ ( "http://www.globalbono.com/barcelona/aparato-de-gimnasia.html" ) Antes 250,00€ Dto: 50% Ahorro: 125,16€ 35% Dto. Corta Fiambre Corta fiambres semi profesional y no te canses cortando embutido, ... 44,70€ ( "http://www.globalbono.com/barcelona/corta-fiambre.html" ) Antes 69,00€ Dto: 35% Ahorro: 24,30€ 34% Dto. Envasadora al Vacío Envasadora al vacío para que conserves tus alimentos siempre fresc... 50,50€ ( "http://www.globalbono.com/barcelona/envasadora-al-vacio.html" ) Antes 77,00€ Dto: 34% Ahorro: 26,50€ 50% Dto. Conoce Zaragoza, Dos Días y Una Noche en Hotel Cuatro Estrellas Visita la ciudad de Zaragoza, recorre sus monumentos mas emblemáti... 35,00€ ( "http://www.globalbono.com/barcelona/conoce-zaragoza-dos-dias-y-una-noche-en-hotel-cuatro-estrellas.html" ) Antes 70,00€ Dto: 50% Ahorro: 35,00€ 38% Dto. Siete Noches en Maldivas, Hotel Paradise Island 5*, Pensión Completa, Vuelos Incluidos Pásate una semana en las Maldivas, en el Hotel Paradise Island Res... 1.630,00€ ( "http://www.globalbono.com/barcelona/siete-noches-en-maldivas-hotel-paradise-island-vuelos-incluidos.html" ) Antes 2.650,00€ Dto: 38% Ahorro: 1.020,00€ 55% Dto. Vitoria, Dos Días y Una Noche de Relax y Lujo en el Gran Hotel Lakua, Cinco Estrellas. Ven a Euskadi, disfruta y recorre la hermosa Vitoria, y relájate d... 58,00€ ( "http://www.globalbono.com/barcelona/vitoria-dos-dias-y-una-noche-de-relax-y-lujo-en-el-gran-hotel-lakua-cinco-estrellas.html" ) Antes 130,00€ Dto: 55% Ahorro: 72,00€ 50% Dto. Oviedo, Gastronomía de Lujo, Dos Días y Una Noche en Hotel Cinco Estrellas Conoce Oviedo mientras te deleitas con un menú típico asturiano, y... 60,00€ ( "http://www.globalbono.com/barcelona/oviedo-gastronomia-de-lujo-dos-dias-y-una-noche-en-hotel-cinco-estrellas.html" ) Antes 120,00€ Dto: 50% Ahorro: 60,00€ 54% Dto. Esterilizador de Biberones Esterilizador de biberones y tetillas, para que consigas la esteri... 20,70€ ( "http://www.globalbono.com/barcelona/esterilizador-de-biberones.html" ) Antes 45,00€ Dto: 54% Ahorro: 24,30€ 28% Dto. Nueva York y Circuito en las Cataratas del Niágara, Vuelo Incluido, Nueve Días y Siete Noches Desde Nueva York a Toronto, conoce los dos lugares más emblemático... 1.348,00€ ( "http://www.globalbono.com/barcelona/nueva-york-y-circuito-en-las-cataratas-del-niagara-vuelo-incluido-nueve-dias-y-siete-noches.html" ) Antes 1.885,00€ Dto: 28% Ahorro: 537,00€ De conformidad con lo que establece la Ley Orgánica 15/1999 de Protección de Datos de Carácter Personal, le informamos que sus datos personales serán incorporados a un fichero bajo la responsabilidad de GlobalBono, con la finalidad de poder atender los compromisos derivados de la relación que mantenemos con usted. Puede ejercer sus derechos de acceso, cancelación, rectificación y oposición mediante un escrito a la dirección email in...@gl.... Si en el plazo de 30 días no nos comunica lo contrario, entenderemos que los datos no han sido modificados, que se compromete a notificarnos cualquier variación y que tenemos el consentimiento para utilizarlos a fin de poder fidelizar la relación entre las partes. ¿Quieres dejar de recibir este email? Haz click aquí ( "about:{optoutlink}" ). |
|
From: Seiji A. <sei...@hd...> - 2012-07-04 01:54:14
|
Thank you for reviewing my patch.
> > + while (1) {
> > + prev_why = pstore_get_reason_str(prev_reason);
> > + if (!strncmp(entry->var.Data, prev_why, strlen(prev_why)))
> > + break;
> > + prev_reason++;
> > + }
>
> This loop should probably be hardened to cope with bad data. The patch description and code below show intention to overwrite
> garbage data, but this loop will never exit on garbage data.
OK. I will remove infinite loop above.
> > + switch (prev_reason) {
> > + case KMSG_DUMP_PANIC:
> > + case KMSG_DUMP_EMERG:
> > + /* Never erase panic or emergency message */
> > + break;
> > + case KMSG_DUMP_OOPS:
> > + case KMSG_DUMP_RESTART:
> > + case KMSG_DUMP_HALT:
> > + case KMSG_DUMP_POWEROFF:
> > + /* Can erase if new one is error message */
> > + if (new_reason <= KMSG_DUMP_EMERG)
> > + is_erasable = 1;
> > + break;
> > + default:
> > + /* Can erase unknown message */
> > + is_erasable = 1;
>
> It is probably safer to actually complain here at compile time if a reason is missing. prev_reason is an enum though, so if all cases are
> accounted for and no default is specified, gcc should complain if a new KMSG_DUMP enum value is added to the codebase without
> considering this logic here.
It makes sense.
I will remove "default" and add all cases of "KMSG_DUMP_*".
In latest linus-tree, KMSG_DUMP_UNDEF is added.
I will check how we should treat it.
> > + if (!can_erase_entry(entry, reason)) {
> > + /* return without writing new entry */
> > + spin_unlock(&efivars->lock);
> > + *id = part;
> > + return ret;
> > + }
>
> I'm not sure how comfortable I am with the code duplication here. Was using a flag not workable?
If efi_pstore doesn't write new entry, it should return with non-zero value.
I will update my patch by changing to "return -EEXIST " or so.
Also, I will fix typo you pointed out.
Thanks,
Seiji
|
|
From: Seiji A. <sei...@hd...> - 2012-07-04 01:22:37
|
> Perhaps update the comment in include/linux/kmsg_dump.h to mention that <= KMSG_DUMP_EMERG may overwrite less important > logs (since it already mentions the importance of order and significance of the OOPS level). I will update my patch by adding some comment to linux/kmsg_dump.h Thanks, Seiji |
|
From: Mike W. <mi...@go...> - 2012-07-04 01:19:27
|
On 07/03/2012 04:35 PM, Seiji Aguchi wrote:
> This patch introduces a following rule checking if an existing entry in NVRAM are erasable to avoid missing
> a critical message ,such as panic, before an user check it.
>
> - In case where an existing entry is panic or emergency
> - It is not erasable because if panic/emergency event is lost, we have no way to detect
> the root cause. We shouldn't overwrite them for any reason.
>
> - In case where an existing entry is oops/shutdown/halt/poweroff
> - It is erasable if an error ,panic, emergency or oops, happen in new event.
> - Oops is erasable because system may still be running and its message may be saved
> into /var/log/messages.
> - Also, normal event ,shutdown/halt/poweroff, is erasable because error message is
> more important than normal message.
>
> - In case where an existing entry is unknown event
> - It is erasable because any event supported by pstore outweighs unsupported events.
>
> Signed-off-by: Seiji Aguchi <sei...@hd...>
> ---
> drivers/firmware/efivars.c | 48 +++++++++++++++++++++++++++++++++++++++++++-
> fs/pstore/platform.c | 4 +-
> include/linux/pstore.h | 5 ++++
> 3 files changed, 54 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 4929254..54d9bc6 100644
> --- a/drivers/firmware/efivars.c
> +++ b/drivers/firmware/efivars.c
> @@ -685,6 +685,45 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
> return 0;
> }
>
> +
> +static bool can_erase_entry(struct efivar_entry *entry, enum kmsg_dump_reason
> + new_reason)
> +{
> + int prev_reason = 0;
> + const char *prev_why;
> + bool is_erasable = 0;
> +
> + /* Get a reason of previous message */
> + while (1) {
> + prev_why = pstore_get_reason_str(prev_reason);
> + if (!strncmp(entry->var.Data, prev_why, strlen(prev_why)))
> + break;
> + prev_reason++;
> + }
This loop should probably be hardened to cope with bad data. The patch
description and code below show intention to overwrite garbage data, but
this loop will never exit on garbage data.
> +
> + /* check if exisiting message is erasable */
existing
> +
> + switch (prev_reason) {
> + case KMSG_DUMP_PANIC:
> + case KMSG_DUMP_EMERG:
> + /* Never erase panic or emergency message */
> + break;
> + case KMSG_DUMP_OOPS:
> + case KMSG_DUMP_RESTART:
> + case KMSG_DUMP_HALT:
> + case KMSG_DUMP_POWEROFF:
> + /* Can erase if new one is error message */
> + if (new_reason <= KMSG_DUMP_EMERG)
> + is_erasable = 1;
> + break;
> + default:
> + /* Can erase unknown message */
> + is_erasable = 1;
It is probably safer to actually complain here at compile time if a
reason is missing. prev_reason is an enum though, so if all cases are
accounted for and no default is specified, gcc should complain if a new
KMSG_DUMP enum value is added to the codebase without considering this
logic here.
> + }
> +
> + return is_erasable;
> +}
> +
> static int efi_pstore_write(enum pstore_type_id type,
> enum kmsg_dump_reason reason, u64 *id,
> unsigned int part, size_t size, struct pstore_info *psi) @@ -706,7 +745,7 @@ static int efi_pstore_write(enum pstore_type_id type,
> efi_name[i] = stub_name[i];
>
> /*
> - * Clean up any entries with the same name
> + * Search for erasable entry
> */
>
> list_for_each_entry(entry, &efivars->list, list) { @@ -721,6 +760,13 @@ static int efi_pstore_write(enum pstore_type_id type,
> if (entry->var.VariableName[utf16_strlen(efi_name)] == 0)
> continue;
>
> + if (!can_erase_entry(entry, reason)) {
> + /* return without writing new entry */
> + spin_unlock(&efivars->lock);
> + *id = part;
> + return ret;
> + }
I'm not sure how comfortable I am with the code duplication here. Was
using a flag not workable?
> +
> /* found */
> found = entry;
> efivars->ops->set_variable(entry->var.VariableName,
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 03ce7a9..32715eb 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -68,7 +68,7 @@ void pstore_set_kmsg_bytes(int bytes)
> /* Tag each group of saved records with a sequence number */
> static int oopscount;
>
> -static const char *get_reason_str(enum kmsg_dump_reason reason)
> +const char *pstore_get_reason_str(enum kmsg_dump_reason reason)
> {
> switch (reason) {
> case KMSG_DUMP_PANIC:
> @@ -104,7 +104,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,
> int is_locked = 0;
> int ret;
>
> - why = get_reason_str(reason);
> + why = pstore_get_reason_str(reason);
>
> if (in_nmi()) {
> is_locked = spin_trylock(&psinfo->buf_lock); diff --git a/include/linux/pstore.h b/include/linux/pstore.h index e1461e1..e9347e9 100644
> --- a/include/linux/pstore.h
> +++ b/include/linux/pstore.h
> @@ -54,12 +54,17 @@ struct pstore_info {
>
> #ifdef CONFIG_PSTORE
> extern int pstore_register(struct pstore_info *);
> +extern const char *pstore_get_reason_str(enum kmsg_dump_reason reason);
> #else
> static inline int
> pstore_register(struct pstore_info *psi) {
> return -ENODEV;
> }
> +static const char *pstore_get_reason_str(enum kmsg_dump_reason reason)
> +{
> + return NULL;
> +}
> #endif
>
> #endif /*_LINUX_PSTORE_H*/
> --
> 1.7.1
>
>
|
|
From: Luck, T. <ton...@in...> - 2012-07-03 23:58:20
|
Perhaps update the comment in include/linux/kmsg_dump.h to mention that <= KMSG_DUMP_EMERG may overwrite less important logs (since it already mentions the importance of order and significance of the OOPS level). -Tony |
|
From: Seiji A. <sei...@hd...> - 2012-07-03 23:35:55
|
This patch introduces a following rule checking if an existing entry in NVRAM are erasable to avoid missing
a critical message ,such as panic, before an user check it.
- In case where an existing entry is panic or emergency
- It is not erasable because if panic/emergency event is lost, we have no way to detect
the root cause. We shouldn't overwrite them for any reason.
- In case where an existing entry is oops/shutdown/halt/poweroff
- It is erasable if an error ,panic, emergency or oops, happen in new event.
- Oops is erasable because system may still be running and its message may be saved
into /var/log/messages.
- Also, normal event ,shutdown/halt/poweroff, is erasable because error message is
more important than normal message.
- In case where an existing entry is unknown event
- It is erasable because any event supported by pstore outweighs unsupported events.
Signed-off-by: Seiji Aguchi <sei...@hd...>
---
drivers/firmware/efivars.c | 48 +++++++++++++++++++++++++++++++++++++++++++-
fs/pstore/platform.c | 4 +-
include/linux/pstore.h | 5 ++++
3 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 4929254..54d9bc6 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -685,6 +685,45 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
return 0;
}
+
+static bool can_erase_entry(struct efivar_entry *entry, enum kmsg_dump_reason
+ new_reason)
+{
+ int prev_reason = 0;
+ const char *prev_why;
+ bool is_erasable = 0;
+
+ /* Get a reason of previous message */
+ while (1) {
+ prev_why = pstore_get_reason_str(prev_reason);
+ if (!strncmp(entry->var.Data, prev_why, strlen(prev_why)))
+ break;
+ prev_reason++;
+ }
+
+ /* check if exisiting message is erasable */
+
+ switch (prev_reason) {
+ case KMSG_DUMP_PANIC:
+ case KMSG_DUMP_EMERG:
+ /* Never erase panic or emergency message */
+ break;
+ case KMSG_DUMP_OOPS:
+ case KMSG_DUMP_RESTART:
+ case KMSG_DUMP_HALT:
+ case KMSG_DUMP_POWEROFF:
+ /* Can erase if new one is error message */
+ if (new_reason <= KMSG_DUMP_EMERG)
+ is_erasable = 1;
+ break;
+ default:
+ /* Can erase unknown message */
+ is_erasable = 1;
+ }
+
+ return is_erasable;
+}
+
static int efi_pstore_write(enum pstore_type_id type,
enum kmsg_dump_reason reason, u64 *id,
unsigned int part, size_t size, struct pstore_info *psi) @@ -706,7 +745,7 @@ static int efi_pstore_write(enum pstore_type_id type,
efi_name[i] = stub_name[i];
/*
- * Clean up any entries with the same name
+ * Search for erasable entry
*/
list_for_each_entry(entry, &efivars->list, list) { @@ -721,6 +760,13 @@ static int efi_pstore_write(enum pstore_type_id type,
if (entry->var.VariableName[utf16_strlen(efi_name)] == 0)
continue;
+ if (!can_erase_entry(entry, reason)) {
+ /* return without writing new entry */
+ spin_unlock(&efivars->lock);
+ *id = part;
+ return ret;
+ }
+
/* found */
found = entry;
efivars->ops->set_variable(entry->var.VariableName,
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 03ce7a9..32715eb 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -68,7 +68,7 @@ void pstore_set_kmsg_bytes(int bytes)
/* Tag each group of saved records with a sequence number */
static int oopscount;
-static const char *get_reason_str(enum kmsg_dump_reason reason)
+const char *pstore_get_reason_str(enum kmsg_dump_reason reason)
{
switch (reason) {
case KMSG_DUMP_PANIC:
@@ -104,7 +104,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,
int is_locked = 0;
int ret;
- why = get_reason_str(reason);
+ why = pstore_get_reason_str(reason);
if (in_nmi()) {
is_locked = spin_trylock(&psinfo->buf_lock); diff --git a/include/linux/pstore.h b/include/linux/pstore.h index e1461e1..e9347e9 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -54,12 +54,17 @@ struct pstore_info {
#ifdef CONFIG_PSTORE
extern int pstore_register(struct pstore_info *);
+extern const char *pstore_get_reason_str(enum kmsg_dump_reason reason);
#else
static inline int
pstore_register(struct pstore_info *psi) {
return -ENODEV;
}
+static const char *pstore_get_reason_str(enum kmsg_dump_reason reason)
+{
+ return NULL;
+}
#endif
#endif /*_LINUX_PSTORE_H*/
--
1.7.1
|
|
From: Seiji A. <sei...@hd...> - 2012-07-03 23:35:11
|
This patch duplicates a code of erase callback shared with write callback so that they work independently.
Signed-off-by: Seiji Aguchi <sei...@hd...>
---
drivers/firmware/efivars.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 45 insertions(+), 1 deletions(-)
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 47408e8..4929254 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -756,7 +756,51 @@ static int efi_pstore_write(enum pstore_type_id type, static int efi_pstore_erase(enum pstore_type_id type, u64 id,
struct pstore_info *psi)
{
- efi_pstore_write(type, 0, &id, (unsigned int)id, 0, psi);
+ char stub_name[DUMP_NAME_LEN];
+ efi_char16_t efi_name[DUMP_NAME_LEN];
+ efi_guid_t vendor = LINUX_EFI_CRASH_GUID;
+ struct efivars *efivars = psi->data;
+ struct efivar_entry *entry, *found = NULL;
+ int i;
+
+ sprintf(stub_name, "dump-type%u-%llu-", type, id);
+
+ spin_lock(&efivars->lock);
+
+ for (i = 0; i < DUMP_NAME_LEN; i++)
+ efi_name[i] = stub_name[i];
+
+ /*
+ * Clean up any entries with the same name
+ */
+
+ list_for_each_entry(entry, &efivars->list, list) {
+ get_var_data_locked(efivars, &entry->var);
+
+ if (efi_guidcmp(entry->var.VendorGuid, vendor))
+ continue;
+ if (utf16_strncmp(entry->var.VariableName, efi_name,
+ utf16_strlen(efi_name)))
+ continue;
+ /* Needs to be a prefix */
+ if (entry->var.VariableName[utf16_strlen(efi_name)] == 0)
+ continue;
+
+ /* found */
+ found = entry;
+ efivars->ops->set_variable(entry->var.VariableName,
+ &entry->var.VendorGuid,
+ PSTORE_EFI_ATTRIBUTES,
+ 0, NULL);
+ }
+
+ if (found)
+ list_del(&found->list);
+
+ spin_unlock(&efivars->lock);
+
+ if (found)
+ efivar_unregister(found);
return 0;
}
--
1.7.1
|
|
From: Seiji A. <sei...@hd...> - 2012-07-03 23:34:08
|
[Problem] Current efi_pstore simply overwrites existing entries in NVRAM. So, if 2nd panic happens before a user checks 1st panic message, 1st panic message will be lost. [Solution] To avoid missing 1st panic message, this patch introduce a rule checking if existing entries in NRAM are erasable to efi_pstore. [Patch Descriptions] [PATCH 1/2] Duplicate a shared code between write and erase callbacks Currently, efi_pstore driver shares a code erasing existing entries in NVRAM with write and erase callbacks. But there some cases we should avoid erasing existing entries in write callback. (Please see PATCH 2/2). This patch duplicates the code so that write and erase callbacks work independently. [PATCH 2/2] write callback: Check if existing entry is erasable this patch introduce a rule checking if existing entries in NRAM are erasable to efi_pstore. With this patch, if previous event is panic, efi_pstore never overwrite it. drivers/firmware/efivars.c | 94 +++++++++++++++++++++++++++++++++++++++++++- fs/pstore/platform.c | 4 +- include/linux/pstore.h | 5 ++ 3 files changed, 99 insertions(+), 4 deletions(-) Seiji |
|
From: Seiji A. <sei...@hd...> - 2012-07-03 22:34:26
|
As Vaibhav explained in the thread below, tracepoints for irq vectors is useful. http://www.spinics.net/lists/mm-commits/msg85707.html <snip> The current interrupt traces from irq_handler_entry and irq_handler_exit provide when an interrupt is handled. They provide good data about when the system has switched to kernel space and how it affects the currently running processes. There are some IRQ vectors which trigger the system into kernel space, which are not handled in generic IRQ handlers. Tracing such events gives us the information about IRQ interaction with other system events. The trace also tells where the system is spending its time. We want to know which cores are handling interrupts and how they are affecting other processes in the system. Also, the trace provides information about when the cores are idle and which interrupts are changing that state. <snip> On the other hand, my usecase is tracing just local timer event and getting a value of instruction pointer. I suggested to add an argument local timer event to get instruction pointer before. But there is another way to get it with external module like systemtap. So, I don't need to add any argument to irq vector tracepoints now. Vaibhav's patch shared a trace point ,irq_vector_entry/irq_vector_exit, in all events. But there is an above use case to trace specific irq_vector rather than tracing all events. In this case, we are concerned about overhead due to unwanted events. To reduce the overhead, this patch modifies Vaibhav's one to enable each event independently. Signed-off-by: Vaibhav Nagarnaik <vna...@go...> Signed-off-by: Seiji Aguchi <sei...@hd...> --- arch/x86/kernel/apic/apic.c | 7 + arch/x86/kernel/cpu/mcheck/therm_throt.c | 3 + arch/x86/kernel/cpu/mcheck/threshold.c | 3 + arch/x86/kernel/irq.c | 5 + arch/x86/kernel/irq_work.c | 3 + arch/x86/kernel/nmi.c | 3 + arch/x86/kernel/smp.c | 7 + arch/x86/mm/tlb.c | 3 + include/trace/events/irq_vectors.h | 288 ++++++++++++++++++++++++++++++ 9 files changed, 322 insertions(+), 0 deletions(-) create mode 100644 include/trace/events/irq_vectors.h diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 39a222e..db219c9 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -34,6 +34,7 @@ #include <linux/dmi.h> #include <linux/smp.h> #include <linux/mm.h> +#include <trace/events/irq_vectors.h> #include <asm/irq_remapping.h> #include <asm/perf_event.h> @@ -895,7 +896,9 @@ void __irq_entry smp_apic_timer_interrupt(struct pt_regs *regs) */ irq_enter(); exit_idle(); + trace_local_timer_entry(LOCAL_TIMER_VECTOR); local_apic_timer_interrupt(); + trace_local_timer_exit(LOCAL_TIMER_VECTOR); irq_exit(); set_irq_regs(old_regs); @@ -1881,6 +1884,7 @@ void smp_spurious_interrupt(struct pt_regs *regs) irq_enter(); exit_idle(); + trace_spurious_apic_entry(SPURIOUS_APIC_VECTOR); /* * Check if this really is a spurious interrupt and ACK it * if it is a vectored one. Just in case... @@ -1895,6 +1899,7 @@ void smp_spurious_interrupt(struct pt_regs *regs) /* see sw-dev-man vol 3, chapter 7.4.13.5 */ pr_info("spurious APIC interrupt on CPU#%d, " "should never happen.\n", smp_processor_id()); + trace_spurious_apic_exit(SPURIOUS_APIC_VECTOR); irq_exit(); } @@ -1918,6 +1923,7 @@ void smp_error_interrupt(struct pt_regs *regs) irq_enter(); exit_idle(); + trace_error_apic_entry(ERROR_APIC_VECTOR); /* First tickle the hardware, only then report what went on. -- REW */ v0 = apic_read(APIC_ESR); apic_write(APIC_ESR, 0); @@ -1938,6 +1944,7 @@ void smp_error_interrupt(struct pt_regs *regs) apic_printk(APIC_DEBUG, KERN_CONT "\n"); + trace_error_apic_exit(ERROR_APIC_VECTOR); irq_exit(); } diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 47a1870..79cc87a 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c @@ -23,6 +23,7 @@ #include <linux/init.h> #include <linux/smp.h> #include <linux/cpu.h> +#include <trace/events/irq_vectors.h> #include <asm/processor.h> #include <asm/apic.h> @@ -382,8 +383,10 @@ asmlinkage void smp_thermal_interrupt(struct pt_regs *regs) { irq_enter(); exit_idle(); + trace_thermal_apic_entry(THERMAL_APIC_VECTOR); inc_irq_stat(irq_thermal_count); smp_thermal_vector(); + trace_thermal_apic_exit(THERMAL_APIC_VECTOR); irq_exit(); /* Ack only at the end to avoid potential reentry */ ack_APIC_irq(); diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c index aa578ca..45f33a3 100644 --- a/arch/x86/kernel/cpu/mcheck/threshold.c +++ b/arch/x86/kernel/cpu/mcheck/threshold.c @@ -3,6 +3,7 @@ */ #include <linux/interrupt.h> #include <linux/kernel.h> +#include <trace/events/irq_vectors.h> #include <asm/irq_vectors.h> #include <asm/apic.h> @@ -21,8 +22,10 @@ asmlinkage void smp_threshold_interrupt(void) { irq_enter(); exit_idle(); + trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); inc_irq_stat(irq_threshold_count); mce_threshold_vector(); + trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR); irq_exit(); /* Ack only at the end to avoid potential reentry */ ack_APIC_irq(); diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 3dafc60..e6786a1 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -18,6 +18,9 @@ #include <asm/mce.h> #include <asm/hw_irq.h> +#define CREATE_TRACE_POINTS +#include <trace/events/irq_vectors.h> + atomic_t irq_err_count; /* Function pointer for generic interrupt vector handling */ @@ -218,11 +221,13 @@ void smp_x86_platform_ipi(struct pt_regs *regs) exit_idle(); + trace_x86_platform_ipi_entry(X86_PLATFORM_IPI_VECTOR); inc_irq_stat(x86_platform_ipis); if (x86_platform_ipi_callback) x86_platform_ipi_callback(); + trace_x86_platform_ipi_exit(X86_PLATFORM_IPI_VECTOR); irq_exit(); set_irq_regs(old_regs); diff --git a/arch/x86/kernel/irq_work.c b/arch/x86/kernel/irq_work.c index ca8f703..2cf7505 100644 --- a/arch/x86/kernel/irq_work.c +++ b/arch/x86/kernel/irq_work.c @@ -8,13 +8,16 @@ #include <linux/irq_work.h> #include <linux/hardirq.h> #include <asm/apic.h> +#include <trace/events/irq_vectors.h> void smp_irq_work_interrupt(struct pt_regs *regs) { irq_enter(); ack_APIC_irq(); + trace_irq_work_entry(IRQ_WORK_VECTOR); inc_irq_stat(apic_irq_work_irqs); irq_work_run(); + trace_irq_work_exit(IRQ_WORK_VECTOR); irq_exit(); } diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index a0b2f84..84e8102 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -28,6 +28,7 @@ #include <asm/mach_traps.h> #include <asm/nmi.h> #include <asm/x86_init.h> +#include <trace/events/irq_vectors.h> struct nmi_desc { spinlock_t lock; @@ -463,12 +464,14 @@ do_nmi(struct pt_regs *regs, long error_code) nmi_nesting_preprocess(regs); nmi_enter(); + trace_nmi_entry(NMI_VECTOR); inc_irq_stat(__nmi_count); if (!ignore_nmis) default_do_nmi(regs); + trace_nmi_exit(NMI_VECTOR); nmi_exit(); /* On i386, may loop back to preprocess */ diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index 48d2b7d..5b2d6de 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -23,6 +23,7 @@ #include <linux/interrupt.h> #include <linux/cpu.h> #include <linux/gfp.h> +#include <trace/events/irq_vectors.h> #include <asm/mtrr.h> #include <asm/tlbflush.h> @@ -252,8 +253,10 @@ finish: void smp_reschedule_interrupt(struct pt_regs *regs) { ack_APIC_irq(); + trace_reschedule_entry(RESCHEDULE_VECTOR); inc_irq_stat(irq_resched_count); scheduler_ipi(); + trace_reschedule_exit(RESCHEDULE_VECTOR); /* * KVM uses this interrupt to force a cpu out of guest mode */ @@ -263,8 +266,10 @@ void smp_call_function_interrupt(struct pt_regs *regs) { ack_APIC_irq(); irq_enter(); + trace_call_function_entry(CALL_FUNCTION_VECTOR); generic_smp_call_function_interrupt(); inc_irq_stat(irq_call_count); + trace_call_function_exit(CALL_FUNCTION_VECTOR); irq_exit(); } @@ -272,8 +277,10 @@ void smp_call_function_single_interrupt(struct pt_regs *regs) { ack_APIC_irq(); irq_enter(); + trace_call_function_single_entry(CALL_FUNCTION_SINGLE_VECTOR); generic_smp_call_function_single_interrupt(); inc_irq_stat(irq_call_count); + trace_call_function_single_exit(CALL_FUNCTION_SINGLE_VECTOR); irq_exit(); } diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 5e57e11..8a66e91 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -5,6 +5,7 @@ #include <linux/smp.h> #include <linux/interrupt.h> #include <linux/module.h> +#include <trace/events/irq_vectors.h> #include <linux/cpu.h> #include <asm/tlbflush.h> @@ -143,6 +144,7 @@ void smp_invalidate_interrupt(struct pt_regs *regs) sender = ~regs->orig_ax - INVALIDATE_TLB_VECTOR_START; f = &flush_state[sender]; + trace_invalidate_tlb_entry(INVALIDATE_TLB_VECTOR_START + sender); if (!cpumask_test_cpu(cpu, to_cpumask(f->flush_cpumask))) goto out; /* @@ -169,6 +171,7 @@ out: cpumask_clear_cpu(cpu, to_cpumask(f->flush_cpumask)); smp_mb__after_clear_bit(); inc_irq_stat(irq_tlb_count); + trace_invalidate_tlb_exit(INVALIDATE_TLB_VECTOR_START + sender); } static void flush_tlb_others_ipi(const struct cpumask *cpumask, diff --git a/include/trace/events/irq_vectors.h b/include/trace/events/irq_vectors.h new file mode 100644 index 0000000..4c1cb4e --- /dev/null +++ b/include/trace/events/irq_vectors.h @@ -0,0 +1,288 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM irq_vectors + +#if !defined(_TRACE_IRQ_VECTORS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_IRQ_VECTORS_H + +#include <linux/tracepoint.h> +#include <asm/irq.h> + +DECLARE_EVENT_CLASS(irq_vector, + + TP_PROTO(int irq), + + TP_ARGS(irq), + + TP_STRUCT__entry( + __field( int, irq ) + ), + + TP_fast_assign( + __entry->irq = irq; + ), + + TP_printk("irq=%d", __entry->irq) +); + +/* + * nmi_entry - called before enterring a nmi vector handler + */ +DEFINE_EVENT(irq_vector, nmi_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * nmi_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, nmi_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * local_timer_entry - called before enterring a local timer interrupt + * vector handler + */ +DEFINE_EVENT(irq_vector, local_timer_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * local_timer_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, local_timer_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * error_apic_entry - called before enterring an error apic vector handler + */ +DEFINE_EVENT(irq_vector, error_apic_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * error_apic_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, error_apic_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * reschedule_entry - called before enterring a reschedule vector handler + */ +DEFINE_EVENT(irq_vector, reschedule_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * reschedule_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, reschedule_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * call_function_entry - called before enterring a call function + * vector handler + */ +DEFINE_EVENT(irq_vector, call_function_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * call_function_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, call_function_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * call_function_single_entry - called before enterring a call function + * single vector handler + */ +DEFINE_EVENT(irq_vector, call_function_single_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * call_function_single_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, call_function_single_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * thermal_apic_entry - called before enterring a thermal apic vector handler + */ +DEFINE_EVENT(irq_vector, thermal_apic_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * thermal_apic_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, thermal_apic_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * threshold_apic_entry - called before enterring a threshold apic + * vector handler + */ +DEFINE_EVENT(irq_vector, threshold_apic_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * threshold_apic_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, threshold_apic_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * spurious_apic_entry - called before enterring a spurious apic vector handler + */ +DEFINE_EVENT(irq_vector, spurious_apic_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * spurious_apic_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, spurious_apic_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * irq_work_entry - called before enterring an irq work vector handler + */ +DEFINE_EVENT(irq_vector, irq_work_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * irq_work_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, irq_work_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * x86_platform_ipi_entry - called before enterring a x86 platform ipi + * vector handler + */ +DEFINE_EVENT(irq_vector, x86_platform_ipi_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * x86_platform_ipi_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, x86_platform_ipi_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * invalidate_tlb_entry - called before enterring an invalidate tlb + * vector handler + */ +DEFINE_EVENT(irq_vector, invalidate_tlb_entry, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +/* + * invalidate_tlb_exit - called immediately after the interrupt vector + * handler returns + */ +DEFINE_EVENT(irq_vector, invalidate_tlb_exit, + + TP_PROTO(int irq), + + TP_ARGS(irq) +); + +#endif /* _TRACE_IRQ_VECTORS_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> -- 1.7.1 |
|
From: 深圳户口办理 <ad...@zy...> - 2012-06-27 16:44:19
|
<P align=center><FONT color=#ff0000 size=6>2012年深圳人才引进问题协助</FONT></P> <P> 2012年是深圳人才引进变革的一年,调干政策有一些略微的变更但是原来的招调工政策已经不存在而全部变成积分入户政策,积分入户虽然看起来简单但是在操作流程和审核资料的过程中有很多难点,以前企业里办理了很多年招调工业务的人员都会出现一些错误导致企业员工办理户口失败在积分这种审核引进人才多元素资料的情况下出现的问题将会更多、、、</P> <P><FONT color=#ff0000>中亚兴(启众)户口办理协助你解决户口办理过程中的难题:</FONT></P> <P>A、 由从事多年户口办理经验的专家进企业讲解积分入户政策及办理流程,并可解答企业及个人办理户口 疑难问题。费用按天收取。<BR>B、 全程协助企业员工及个人办理调干及积分入户。费用按照人数协商。<BR>C、 企业人才引进业务外包,即由我们公司专业人员全程办理企业员工的人才引进业务,包括公司立户、员工资料准备协助、员工资料审核、递交。企业须派一内部员工协助。</P> <P>专业为企业人事、老板个人解决深圳户口疑难问题:(敬请留用,以备后用)</P> <P>1、公司纳税不够立户问题,协助企业给员工办理深圳户口;<BR>2、招调工、调干调令下不来,资料交上去调令没结果;<BR>3、招调工资格证书包过咨询办理,积分入户办理咨询;<BR>4、招调工档案、调干档案丢失、资料不够不能办理户口等疑难问题帮你解决;<BR>5、大专、本科疑难学历验证、快速出验证报告;<BR>6、深圳社保补交、挂靠</P> <P><BR> 深圳市中亚兴职业培训(深圳市启众文化传播有限公司)提供包括毕业生接收、调干、招调工在内的多种深圳户口解决方案。针对客户的具体情况,量身裁衣,为你制订符合你自身要求入户方案。我们具有多年人才引进咨询服务经验,提供全程方案策划、政策咨询解答,解决疑难问题能力强,精通人才引进政策、服务体系完善。<BR> <BR> 我们的核心团队是由资深人力资源专家、人事劳动专业律师、政府官员和专业执行团队组成的,我们全体员工均拥有国内知名大学本科以上学历,不但拥有扎实的专业知识而且具备多年的人力资源实践工作经验,是集理论与实践为一体的专业化人才。<BR> <BR>相信凭着我们的的专业和热忱肯定能为你带来最好的服务。</P> <P><BR>在线QQ:270075428、 429364855、20810405 网址:<A href="http://www.zyxstar.com/">www.zyxstar.com</A><BR>咨询电话:15986651800 张先生、13418507373向小姐、13510290885郭先生<BR></P> |
|
From: Greg KH <gr...@li...> - 2012-06-20 18:22:20
|
3.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Seiji Aguchi <sei...@hd...> commit 62be73eafaa045d3233337303fb140f7f8a61135 upstream. This patch moves kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop(), to serialize the crash-logging process via smp_send_stop() and to thus retrieve a more stable crash image of all CPUs stopped. Signed-off-by: Seiji Aguchi <sei...@hd...> Acked-by: Don Zickus <dz...@re...> Cc: dle...@li... <dle...@li...> Cc: Satoru Moriya <sat...@hd...> Cc: Tony Luck <ton...@in...> Cc: a.p...@ch... <a.p...@ch...> Link: http://lkml.kernel.org/r/5C4...@US... Signed-off-by: Ingo Molnar <mi...@ke...> Signed-off-by: Greg Kroah-Hartman <gr...@li...> --- kernel/panic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/panic.c +++ b/kernel/panic.c @@ -108,8 +108,6 @@ void panic(const char *fmt, ...) */ crash_kexec(NULL); - kmsg_dump(KMSG_DUMP_PANIC); - /* * Note smp_send_stop is the usual smp shutdown function, which * unfortunately means it may not be hardened to work in a panic @@ -117,6 +115,8 @@ void panic(const char *fmt, ...) */ smp_send_stop(); + kmsg_dump(KMSG_DUMP_PANIC); + atomic_notifier_call_chain(&panic_notifier_list, 0, buf); bust_spinlocks(0); |
|
From: <gr...@li...> - 2012-06-18 17:02:08
|
This is a note to let you know that I've just added the patch titled
kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()
to the 3.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
kdump-execute-kmsg_dump-kmsg_dump_panic-after-smp_send_stop.patch
and it can be found in the queue-3.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <st...@vg...> know about it.
>From 62be73eafaa045d3233337303fb140f7f8a61135 Mon Sep 17 00:00:00 2001
From: Seiji Aguchi <sei...@hd...>
Date: Tue, 15 May 2012 17:35:09 -0400
Subject: kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()
From: Seiji Aguchi <sei...@hd...>
commit 62be73eafaa045d3233337303fb140f7f8a61135 upstream.
This patch moves kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop(),
to serialize the crash-logging process via smp_send_stop() and to
thus retrieve a more stable crash image of all CPUs stopped.
Signed-off-by: Seiji Aguchi <sei...@hd...>
Acked-by: Don Zickus <dz...@re...>
Cc: dle...@li... <dle...@li...>
Cc: Satoru Moriya <sat...@hd...>
Cc: Tony Luck <ton...@in...>
Cc: a.p...@ch... <a.p...@ch...>
Link: http://lkml.kernel.org/r/5C4...@US...
Signed-off-by: Ingo Molnar <mi...@ke...>
Signed-off-by: Greg Kroah-Hartman <gr...@li...>
---
kernel/panic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -108,8 +108,6 @@ void panic(const char *fmt, ...)
*/
crash_kexec(NULL);
- kmsg_dump(KMSG_DUMP_PANIC);
-
/*
* Note smp_send_stop is the usual smp shutdown function, which
* unfortunately means it may not be hardened to work in a panic
@@ -117,6 +115,8 @@ void panic(const char *fmt, ...)
*/
smp_send_stop();
+ kmsg_dump(KMSG_DUMP_PANIC);
+
atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
bust_spinlocks(0);
Patches currently in stable-queue which might be from sei...@hd... are
queue-3.4/kdump-execute-kmsg_dump-kmsg_dump_panic-after-smp_send_stop.patch
|
|
From: Luck, T. <ton...@in...> - 2012-06-13 23:55:36
|
> I have one question. (It is not directly related to a discussion here.) > Do you mean the limitation is due to EFI specification? > Or do you mean there is no EFI server capable of a much amount of NVRAM? Maybe Matthew can answer that - I wouldn't think that the specification would limit the amount of NVRAM - but I would expect implementations to do so. Generally the EFI persistent space has to share the same flash chip as the BIOS ... and the BIOS folks are good at filling up all the space with their own code & data. These chips are still only a few (4, 8) Megabytes or so. -Tony |
|
From: Seiji A. <sei...@hd...> - 2012-06-13 23:38:39
|
Tony, > - the limitation is EFI I have one question. (It is not directly related to a discussion here.) Do you mean the limitation is due to EFI specification? Or do you mean there is no EFI server capable of a much amount of NVRAM? Seiji |
|
From: Seiji A. <sei...@hd...> - 2012-06-13 23:28:18
|
> I think not - the limitation is EFI (ERST can handle several errors, I think that the ramoops patches are working with the assumption that > enough storage is available too). > I see. > The question is how easy is it for EFI to determine the "type" of the saved error (which may be from the previous booted kernel - so > no use using a global variable ... the information needs to be in persistent store). OK. I will not use the global variable. I can check the previous event from a header supplied by pstore ,such as "Panic#1 Part1". Seiji |
|
From: Luck, T. <ton...@in...> - 2012-06-13 23:20:23
|
> Should it be in pstore layer? > - introducing a new global variable storing a previous trigger. > - deciding if we can continue by checking a value of previous trigger at the beginning of pstore_dump(). I think not - the limitation is EFI (ERST can handle several errors, I think that the ramoops patches are working with the assumption that enough storage is available too). The question is how easy is it for EFI to determine the "type" of the saved error (which may be from the previous booted kernel - so no use using a global variable ... the information needs to be in persistent store). -Tony |
|
From: Seiji A. <sei...@hd...> - 2012-06-13 23:14:35
|
Thank you for your comment. > Since the EFI backend has so little storage space ... perhaps it should have some overwrite rules built into it? I think so. If multiple triggers don't stride across the reboot, I think we can make an automated rule. > If this seems a plausible route ... we'd need to tabulate the overwrite rules. I think they are: > shutdown/reboot/kexec - can be overwritten by OOPS In my usecase, emergency_restart can be overwritten by OOPS > OOPS can be overwritten by panic > panic can never be overwritten I can make a patch in accordance with the rule above. Should it be in pstore layer? - introducing a new global variable storing a previous trigger. - deciding if we can continue by checking a value of previous trigger at the beginning of pstore_dump(). > I'd like to avoid a kernel parameter ... chances are too high that the machine would be automatically rebooted without the right boot > argument. But, I'm not sure if we can simply apply the rule above in case where multiple triggers stride across the reboot... In this case, emergency_restart cannot be overwritten by panic.. Anyway, I will consider the possibility of avoiding a kernel parameter. Seiji |
|
From: Luck, T. <ton...@in...> - 2012-06-13 20:43:26
|
> 4. kernel panics again before a user checks the 1st panic messages in NVRAM. > > > To avoid missing 1st panic messages, this patch adds a new parameter ,efi_pstore_overwrite, > to efi_pstore so that we can specify whether efi_pstore overwrites existing entries in NVRAM or not. Since the EFI backend has so little storage space ... perhaps it should have some overwrite rules built into it? E.g. in the case where there is an OOPS already logged, and a panic happens, then I think the right thing to do is overwrite the oops with the panic. [The oops *might* have already made it to /var/log/messages, but even if it didn't, a user with a PICK ONLY ONE choice would have to go for the log of the panic] In the situation you describe where we already have a panic, then I don't think than anyone would want the earlier panic to be overwritten by the new one. If this seems a plausible route ... we'd need to tabulate the overwrite rules. I think they are: shutdown/reboot/kexec - can be overwritten by OOPS OOPS can be overwritten by panic panic can never be overwritten I'd like to avoid a kernel parameter ... chances are too high that the machine would be automatically rebooted without the right boot argument. -Tony |
|
From: Mike W. <mi...@go...> - 2012-06-13 20:25:20
|
On Wed, Jun 13, 2012 at 6:42 AM, Seiji Aguchi <sei...@hd...> wrote:
>
> Currently, efi_pstore driver simply overwrites existing panic messages in NVRAM.
> So, in the following scenario, we will lose 1st panic messages.
>
> 1. kernel panics.
> 2. efi_pstore is kicked and writes panic messages to NVRAM.
> 3. system shutdowns and boots up.
> 4. kernel panics again before a user checks the 1st panic messages in NVRAM.
>
>
> To avoid missing 1st panic messages, this patch adds a new parameter ,efi_pstore_overwrite,
> to efi_pstore so that we can specify whether efi_pstore overwrites existing entries in NVRAM or not.
>
>
> Signed-off-by: Seiji Aguchi <sei...@hd...>
Acked-by: Mike Waychison <mi...@go...>
>
> ---
> Documentation/kernel-parameters.txt | 6 ++++
> drivers/firmware/efivars.c | 55 +++++++++++++++++++---------------
> 2 files changed, 37 insertions(+), 24 deletions(-)
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index a92c5eb..990befa 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -786,6 +786,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
> edd= [EDD]
> Format: {"off" | "on" | "skip[mbr]"}
>
> + efivars.efi_pstore_overwrite=
> + Specify whether efi_pstore overwrites existing entries
> + in NVRAM
> + Format: <bool> (1/Y/y=yes, 0/N/n=no)
> + default: yes
> +
> eisa_irq_edge= [PARISC,HW]
> See header of drivers/parisc/eisa.c.
>
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 47408e8..94fbd1d 100644
> --- a/drivers/firmware/efivars.c
> +++ b/drivers/firmware/efivars.c
> @@ -685,6 +685,10 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
> return 0;
> }
>
> +static bool efi_pstore_overwrite = 1;
> +module_param_named(efi_pstore_overwrite, efi_pstore_overwrite,
> + bool, S_IRUGO | S_IWUSR);
> +
> static int efi_pstore_write(enum pstore_type_id type,
> enum kmsg_dump_reason reason, u64 *id,
> unsigned int part, size_t size, struct pstore_info *psi) @@ -705,33 +709,36 @@ static int efi_pstore_write(enum pstore_type_id type,
> for (i = 0; i < DUMP_NAME_LEN; i++)
> efi_name[i] = stub_name[i];
>
> - /*
> - * Clean up any entries with the same name
> - */
> + if (efi_pstore_overwrite) {
> + /*
> + * Clean up any entries with the same name
> + */
> +
> + list_for_each_entry(entry, &efivars->list, list) {
> + get_var_data_locked(efivars, &entry->var);
> +
> + if (efi_guidcmp(entry->var.VendorGuid, vendor))
> + continue;
> + if (utf16_strncmp(entry->var.VariableName, efi_name,
> + utf16_strlen(efi_name)))
> + continue;
> + /* Needs to be a prefix */
> + if (entry->var.VariableName[utf16_strlen(efi_name)]
> + == 0)
> + continue;
> +
> + /* found */
> + found = entry;
> + efivars->ops->set_variable(entry->var.VariableName,
> + &entry->var.VendorGuid,
> + PSTORE_EFI_ATTRIBUTES,
> + 0, NULL);
> + }
>
> - list_for_each_entry(entry, &efivars->list, list) {
> - get_var_data_locked(efivars, &entry->var);
> -
> - if (efi_guidcmp(entry->var.VendorGuid, vendor))
> - continue;
> - if (utf16_strncmp(entry->var.VariableName, efi_name,
> - utf16_strlen(efi_name)))
> - continue;
> - /* Needs to be a prefix */
> - if (entry->var.VariableName[utf16_strlen(efi_name)] == 0)
> - continue;
> -
> - /* found */
> - found = entry;
> - efivars->ops->set_variable(entry->var.VariableName,
> - &entry->var.VendorGuid,
> - PSTORE_EFI_ATTRIBUTES,
> - 0, NULL);
> + if (found)
> + list_del(&found->list);
> }
>
> - if (found)
> - list_del(&found->list);
> -
> for (i = 0; i < DUMP_NAME_LEN; i++)
> efi_name[i] = name[i];
>
> --
> 1.7.1
|
|
From: Seiji A. <sei...@hd...> - 2012-06-13 13:43:26
|
Currently, efi_pstore driver simply overwrites existing panic messages in NVRAM.
So, in the following scenario, we will lose 1st panic messages.
1. kernel panics.
2. efi_pstore is kicked and writes panic messages to NVRAM.
3. system shutdowns and boots up.
4. kernel panics again before a user checks the 1st panic messages in NVRAM.
To avoid missing 1st panic messages, this patch adds a new parameter ,efi_pstore_overwrite,
to efi_pstore so that we can specify whether efi_pstore overwrites existing entries in NVRAM or not.
Signed-off-by: Seiji Aguchi <sei...@hd...>
---
Documentation/kernel-parameters.txt | 6 ++++
drivers/firmware/efivars.c | 55 +++++++++++++++++++---------------
2 files changed, 37 insertions(+), 24 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index a92c5eb..990befa 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -786,6 +786,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
edd= [EDD]
Format: {"off" | "on" | "skip[mbr]"}
+ efivars.efi_pstore_overwrite=
+ Specify whether efi_pstore overwrites existing entries
+ in NVRAM
+ Format: <bool> (1/Y/y=yes, 0/N/n=no)
+ default: yes
+
eisa_irq_edge= [PARISC,HW]
See header of drivers/parisc/eisa.c.
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 47408e8..94fbd1d 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -685,6 +685,10 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
return 0;
}
+static bool efi_pstore_overwrite = 1;
+module_param_named(efi_pstore_overwrite, efi_pstore_overwrite,
+ bool, S_IRUGO | S_IWUSR);
+
static int efi_pstore_write(enum pstore_type_id type,
enum kmsg_dump_reason reason, u64 *id,
unsigned int part, size_t size, struct pstore_info *psi) @@ -705,33 +709,36 @@ static int efi_pstore_write(enum pstore_type_id type,
for (i = 0; i < DUMP_NAME_LEN; i++)
efi_name[i] = stub_name[i];
- /*
- * Clean up any entries with the same name
- */
+ if (efi_pstore_overwrite) {
+ /*
+ * Clean up any entries with the same name
+ */
+
+ list_for_each_entry(entry, &efivars->list, list) {
+ get_var_data_locked(efivars, &entry->var);
+
+ if (efi_guidcmp(entry->var.VendorGuid, vendor))
+ continue;
+ if (utf16_strncmp(entry->var.VariableName, efi_name,
+ utf16_strlen(efi_name)))
+ continue;
+ /* Needs to be a prefix */
+ if (entry->var.VariableName[utf16_strlen(efi_name)]
+ == 0)
+ continue;
+
+ /* found */
+ found = entry;
+ efivars->ops->set_variable(entry->var.VariableName,
+ &entry->var.VendorGuid,
+ PSTORE_EFI_ATTRIBUTES,
+ 0, NULL);
+ }
- list_for_each_entry(entry, &efivars->list, list) {
- get_var_data_locked(efivars, &entry->var);
-
- if (efi_guidcmp(entry->var.VendorGuid, vendor))
- continue;
- if (utf16_strncmp(entry->var.VariableName, efi_name,
- utf16_strlen(efi_name)))
- continue;
- /* Needs to be a prefix */
- if (entry->var.VariableName[utf16_strlen(efi_name)] == 0)
- continue;
-
- /* found */
- found = entry;
- efivars->ops->set_variable(entry->var.VariableName,
- &entry->var.VendorGuid,
- PSTORE_EFI_ATTRIBUTES,
- 0, NULL);
+ if (found)
+ list_del(&found->list);
}
- if (found)
- list_del(&found->list);
-
for (i = 0; i < DUMP_NAME_LEN; i++)
efi_name[i] = name[i];
--
1.7.1
|
|
From: Seiji A. <sei...@hd...> - 2012-05-31 21:49:49
|
Hi I would like to discuss a way to avoid deadlocking of pstore_dump(), kmsg_dump() and platform drivers. At first, I post pstore_dump() part. This patch is based on following comments on my previous patch. http://marc.info/?l=linux-kernel&m=131914554220738&w=2 http://marc.info/?l=linux-kernel&m=132370565114963&w=2 The points are skipping spin_lock in panic case and adding WARN_ON in preparation for future change. Any comments are welcome. Seiji [Patch Description] This patch does followings. - Skip a spin_lock of pstore_dump() in panic case because pstore_dump() is serialized via smp_send_stop. - Add WARN_ON() in "in_nmi() and !panic" case into pstore_dump(). Currently, this condition never becomes true. But if someone adds new kmsg_dump() into NMI path in the future, error record may corrupt. We can trap it and complain with it. Signed-off-by: Seiji Aguchi <sei...@hd...> --- fs/pstore/platform.c | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 82c585f..e5a0354 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -31,6 +31,8 @@ #include <linux/hardirq.h> #include <linux/workqueue.h> +#include <asm-generic/bug.h> + #include "internal.h" /* @@ -107,15 +109,21 @@ static void pstore_dump(struct kmsg_dumper *dumper, int hsize, ret; unsigned int part = 1; unsigned long flags = 0; - int is_locked = 0; why = get_reason_str(reason); - if (in_nmi()) { - is_locked = spin_trylock(&psinfo->buf_lock); - if (!is_locked) - pr_err("pstore dump routine blocked in NMI, may corrupt error record\n"); - } else + /* + * Currently, this condition never becomes true. + * But if someone adds new kmsg_dump() into NMI path in the future, + * error record may corrupt. We can trap it and complain with it. + */ + WARN_ON(in_nmi() && reason != KMSG_DUMP_PANIC); + + /* + * pstore_dump() is serialized in panic case. + * So, we don't need to take any locks. + */ + if (reason != KMSG_DUMP_PANIC) spin_lock_irqsave(&psinfo->buf_lock, flags); oopscount++; while (total < kmsg_bytes) { @@ -145,10 +153,8 @@ static void pstore_dump(struct kmsg_dumper *dumper, total += l1_cpy + l2_cpy; part++; } - if (in_nmi()) { - if (is_locked) - spin_unlock(&psinfo->buf_lock); - } else + + if (reason != KMSG_DUMP_PANIC) spin_unlock_irqrestore(&psinfo->buf_lock, flags); } -- 1.7.1 |
|
From: Jerome M. <jma...@re...> - 2012-05-24 09:16:12
|
On 05/23/2012 10:41 PM, Satoru Moriya wrote: > Hi Andrew, > > This patch has been reviewed for couple of months. > > This patch *only* improves the behavior when the kernel has > enough filebacked pages. It means that it does not change > the behavior when kernel has small number of filebacked pages. > > Kosaki-san pointed out that the threshold which we use > to decide whether filebacked page is enough or not is not > appropriate(*). > > (*) http://www.spinics.net/lists/linux-mm/msg32380.html > > As I described in (**), I believe that threshold discussion > should be done in other thread because it affects not only > swappiness=0 case and the kernel behave the same way with > or without this patch below the threshold. > > (**) http://www.spinics.net/lists/linux-mm/msg34317.html > > The patch may not be perfect but, at least, we can improve > the kernel behavior in the enough filebacked memory case > with this patch. I believe it's better than nothing. > > Do you have any comments about it? > > NOTE: I updated the patch with Acked-by tags > > --- > Sometimes we'd like to avoid swapping out anonymous memory > in particular, avoid swapping out pages of important process or > process groups while there is a reasonable amount of pagecache > on RAM so that we can satisfy our customers' requirements. > > OTOH, we can control how aggressive the kernel will swap memory pages > with /proc/sys/vm/swappiness for global and > /sys/fs/cgroup/memory/memory.swappiness for each memcg. > > But with current reclaim implementation, the kernel may swap out > even if we set swappiness==0 and there is pagecache on RAM. > > This patch changes the behavior with swappiness==0. If we set > swappiness==0, the kernel does not swap out completely > (for global reclaim until the amount of free pages and filebacked > pages in a zone has been reduced to something very very small > (nr_free + nr_filebacked < high watermark)). > > Any comments are welcome. > > Regards, > Satoru Moriya > > Signed-off-by: Satoru Moriya <sat...@hd...> > Acked-by: Minchan Kim <mi...@ke...> > Acked-by: Rik van Riel <ri...@re...> > Acked-by: Jerome Marchand <jma...@re...> |
|
From: Rik v. R. <ri...@re...> - 2012-05-23 21:46:27
|
On 05/23/2012 04:41 PM, Satoru Moriya wrote: > The patch may not be perfect but, at least, we can improve > the kernel behavior in the enough filebacked memory case > with this patch. I believe it's better than nothing. Agreed. > Do you have any comments about it? Only one comment, and it's for Andrew :) > Signed-off-by: Satoru Moriya<sat...@hd...> > Acked-by: Minchan Kim<mi...@ke...> > Acked-by: Rik van Riel<ri...@re...> Andrew, you can turn my Acked-by into a Reviewed-by: Rik van Riel<ri...@re...> This is functionality that many people seem to want, and will not break anything current users typically do. -- All rights reversed |