Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2707167rwb; Fri, 2 Dec 2022 13:54:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VVVeQ/uDTJwriZ/iBTCJGncp8XJwSON7cFXkyeA8CUv43XWbaisx80Aapx7qEPjdCyj+X X-Received: by 2002:a17:906:144e:b0:78d:cd72:8e3e with SMTP id q14-20020a170906144e00b0078dcd728e3emr59783489ejc.212.1670018043919; Fri, 02 Dec 2022 13:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670018043; cv=none; d=google.com; s=arc-20160816; b=cmu/ThPNXNkH7sy2MOtZUXtC1bX+/AzieZX3Dm5d+qyUwsdkSXJcDeE3uvWgJo+tyr 73Bm3KevpHArH7Qj6LoLWR8o5PQ3kcLdV+8zz1FJSYDE/qhyrH6wrVtCebqAdAqvKcls d8ZEmt9785xJ6+fdG0XOac3KScD47Q213vfKOoU4OORo9ewsV/pyjeS7NxcZ1qQRQskv j7ADiQJ4iUDshlmORKzcw8jLBo2BLw0FD6e2JpYIefb18mhyK4jemr5Nyols4P9ksst6 oyX/OGUFYk/I/vhFVM9OSi/Orj9ptVqOQrzEMC/ftE91OsuODrUHGPc3PzrfgJFG3jCa P7aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=f+JtP3YBSpbvSEOM6o4SFDk1XVrfF1sDpnt2nGAMCzw=; b=wH+JVtsULJhkus5YXb2YyD9MksMUtcof3AdcEqyvPLUvjI8bS+NCXeRYNh0YR5/YuH f5P8b8/bZM+taUVU9/5ad9MXGSsObbfZt8EYDJdNartQzKCtHq9owlNxMId6LjCDHRBH gQlL1wawOAJeTZkQmwXlQTA8D2+/pCMETwqDS9EhEoG4t62CS6pLfwXMsavE//qAjNwS twEVpFjfUh25zPOvx6WzBzM0P+uTTMmg0wfRMgZEVH2xIJYKqMxQF6UFR90VRjMGlTRH xAHsEo8g3ovDgt2nHYYjv0c6WGjsI0w+UKs3SqcvPui3V0iViLXbj4y+vl+x1kCXZEY9 /9lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LKeXG9zK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020aa7c707000000b004612915d1a0si7060596edq.507.2022.12.02.13.53.43; Fri, 02 Dec 2022 13:54:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LKeXG9zK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234696AbiLBVpY (ORCPT + 83 others); Fri, 2 Dec 2022 16:45:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbiLBVpX (ORCPT ); Fri, 2 Dec 2022 16:45:23 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE541DB6B4; Fri, 2 Dec 2022 13:45:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670017522; x=1701553522; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=f+JtP3YBSpbvSEOM6o4SFDk1XVrfF1sDpnt2nGAMCzw=; b=LKeXG9zKM2kRPWsXOBmdL133hb4AaMTPH/9JBpT1FbCTqubKjfYHEv6h J6cWBrscLuahh1GhOYAtmBLVR+hPM6JoSdHens8mfd5Eqzv1kdbkLXsYI JsAwuh9snxv0O7EX07gjfnL+XxKZTpFcWLkcCoSH/o5MWrsfyvFZHxXIs SNkQMWR+seDc5AU/U7/GXMW/sepadsCLz+VoBRaUB/xjfY5WHlTGouvzo +zgdF3x5huJDzqP7NQyxiJlb0D19cJjvOnFLIJDqZgTz2X7huU7GVKEBd lX4+kGu34THQwnoJxpQtKH7/qPfcshIH/u6hca1b70L7kk7c6sz9qcAZh g==; X-IronPort-AV: E=McAfee;i="6500,9779,10549"; a="313689059" X-IronPort-AV: E=Sophos;i="5.96,213,1665471600"; d="scan'208";a="313689059" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2022 13:45:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10549"; a="733955426" X-IronPort-AV: E=Sophos;i="5.96,213,1665471600"; d="scan'208";a="733955426" Received: from rsnyder-mobl.amr.corp.intel.com (HELO [10.209.68.71]) ([10.209.68.71]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2022 13:45:21 -0800 Message-ID: <746adf31-e70c-e32d-a35d-72d352af613b@intel.com> Date: Fri, 2 Dec 2022 13:45:20 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v2 01/18] x86/sgx: Call cond_resched() at the end of sgx_reclaim_pages() Content-Language: en-US To: Kristen Carlson Accardi , jarkko@kernel.org, dave.hansen@linux.intel.com, tj@kernel.org, linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, cgroups@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Cc: zhiquan1.li@intel.com, Sean Christopherson References: <20221202183655.3767674-1-kristen@linux.intel.com> <20221202183655.3767674-2-kristen@linux.intel.com> <37de083d-a63b-b2ff-d00a-e890a1ba5eea@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/2/22 13:37, Kristen Carlson Accardi wrote: >>> +static void sgx_reclaim_pages(void) >>> +{ >>> +       __sgx_reclaim_pages(); >>> +       cond_resched(); >>> +} >> Why bother with the wrapper?  Can't we just put cond_resched() in the >> existing sgx_reclaim_pages()? > Because sgx_reclaim_direct() needs to call sgx_reclaim_pages() but not > do the cond_resched(). It was this or add a boolean or something to let > caller's opt out of the resched. Is there a reason sgx_reclaim_direct() *can't* or shouldn't call cond_resched()?