Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964810AbVLBCtJ (ORCPT ); Thu, 1 Dec 2005 21:49:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964811AbVLBCtJ (ORCPT ); Thu, 1 Dec 2005 21:49:09 -0500 Received: from fmr19.intel.com ([134.134.136.18]:55438 "EHLO orsfmr004.jf.intel.com") by vger.kernel.org with ESMTP id S964810AbVLBCtH (ORCPT ); Thu, 1 Dec 2005 21:49:07 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C5F6EA.F1486759" Subject: RE: [BUG] Variable stopmachine_state should be volatile Date: Fri, 2 Dec 2005 10:48:57 +0800 Message-ID: <8126E4F969BA254AB43EA03C59F44E840410AF14@pdsmsx404> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [BUG] Variable stopmachine_state should be volatile Thread-Index: AcX2Ye1c3ke+iIr7T6yNJfnl6QNRugAh25eg From: "Zhang, Yanmin" To: "Pavel Machek" Cc: , "Pallipadi, Venkatesh" , "Shah, Rajesh" X-OriginalArrivalTime: 02 Dec 2005 02:48:58.0565 (UTC) FILETIME=[F192FF50:01C5F6EA] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5180 Lines: 93 This is a multi-part message in MIME format. ------_=_NextPart_001_01C5F6EA.F1486759 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable >>-----Original Message----- >>From: Pavel Machek [mailto:pavel@ucw.cz] >>Sent: 2005=C4=EA12=D4=C21=C8=D5 18:26 >>To: Zhang, Yanmin >>Cc: linux-kernel@vger.kernel.org; Pallipadi, Venkatesh; Shah, Rajesh >>Subject: Re: [BUG] Variable stopmachine_state should be volatile >> >>Hi! >> >>> >>Those barriers should already prevent compiler optimalization, no? = If >>> >>they do not, just use some barriers that do. >>> >>> >>> I hit the problem when compiling 2.6 kernel by intel compiler. >>> How about to change the type of stopmachine_state to atomic_t? >> >>That is certainly safest / very conservative solution. >> Pavel Thanks. The functions are not performance sensitive, so atomic_t is ok. = Here is the new patch. ------_=_NextPart_001_01C5F6EA.F1486759 Content-Type: application/octet-stream; name="stopmachine_state_volatile_2.6.15_rc3_v2.patch" Content-Transfer-Encoding: base64 Content-Description: stopmachine_state_volatile_2.6.15_rc3_v2.patch Content-Disposition: attachment; filename="stopmachine_state_volatile_2.6.15_rc3_v2.patch" LS0tIGxpbnV4LTIuNi4xNS1yYzMva2VybmVsL3N0b3BfbWFjaGluZS5jCTIwMDUtMTEtMjkgMDA6 MDI6NDQuMDAwMDAwMDAwICswODAwCisrKyBsaW51eC0yLjYuMTUtcmMzX2ZpeC9rZXJuZWwvc3Rv cF9tYWNoaW5lLmMJMjAwNS0xMS0zMCAxODo0MTo1NS4wMDAwMDAwMDAgKzA4MDAKQEAgLTEzLDE0 ICsxMywxMiBAQAogICoga3RocmVhZC4gKi8KIAogLyogVGhyZWFkIHRvIHN0b3AgZWFjaCBDUFUg aW4gdXNlciBjb250ZXh0LiAqLwotZW51bSBzdG9wbWFjaGluZV9zdGF0ZSB7Ci0JU1RPUE1BQ0hJ TkVfV0FJVCwKLQlTVE9QTUFDSElORV9QUkVQQVJFLAotCVNUT1BNQUNISU5FX0RJU0FCTEVfSVJR LAotCVNUT1BNQUNISU5FX0VYSVQsCi19OworI2RlZmluZQlTVE9QTUFDSElORV9XQUlUCQkwCisj ZGVmaW5lCVNUT1BNQUNISU5FX1BSRVBBUkUJCTEKKyNkZWZpbmUJU1RPUE1BQ0hJTkVfRElTQUJM RV9JUlEJCTIKKyNkZWZpbmUJU1RPUE1BQ0hJTkVfRVhJVAkJMwogCi1zdGF0aWMgZW51bSBzdG9w bWFjaGluZV9zdGF0ZSBzdG9wbWFjaGluZV9zdGF0ZTsKK3N0YXRpYyBhdG9taWNfdCBzdG9wbWFj aGluZV9zdGF0Z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9pZCBzdG9wbWFjaGluZV9zZXRfc3RhdGUoaW50IHN0YXRlKQogewogCWF0b21pY19zZXQo JnN0b3BtYWNoaW5lX3RocmVhZF9hY2ssIDApOwotCXNtcF93bWIoKTsKLQlzdG9wbWFjaGluZV9z dGF0ZSA9IHN0YXRlOworCWF0b21pY19zZXQoJnN0b3BtYWNoaW5lX3N0YXRlLCBzdGF0ZSk7CiAJ d2hpbGUgKGF0b21pY19yZWFkKCZzdG9wbWFjaGluZV90aHJlYWRfYWNrKSAhPSBzdG9wbWFjaGlu ZV9udW1fdGhyZWFkcykKIAkJY3B1X3JlbGF4KCk7CiB9CkBAIC05Nyw3ICs5MCw3IEBAIHN0YXRp YyBpbnQgc3RvcF9tYWNoaW5lKHZvaWQpCiAKIAlhdG9taWNfc2V0KCZzdG9wbWFjaGluZV90aHJl YWRfYWNrLCAwKTsKIAlzdG9wbWFjaGluZV9udW1fdGhyZWFkcyA9IDA7Ci0Jc3RvcG1hY2hpbmVf c3RhdGUgPSBTVE9QTUFDSElORV9XQUlUOworCWF0b21pY19zZXQoJnN0b3BtYWNoaW5lX3N0YXRl LCBTVE9QTUFDSElORV9XQUlUKTsKIAogCWZvcl9lYWNoX29ubGluZV9jcHUoaSkgewogCQlpZiAo aSA9PSByYXdfc21wX3Byb2Nlc3Nvcl9pZCgpKQo= ------_=_NextPart_001_01C5F6EA.F1486759-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/