Let us see below what Rashi says on this verse -
שני חיי שרה THE YEARS OF SARAH’S LIFE — The word years is repeated and without a number to indicate that they were all equally good.
Rashi seems to be saying over here that all the days of Sarahs life were good. However, we know that she had a life of suffering (Her interaction with Pharaoh in Egypt, and with Avimelech, and specifically she had no child her whole entire life as she was barren), so how is it possible to say all the days of her life were good?
Let us answer by prefacing with a teaching of the sages -
We see based on the above Talmud teaching that the men of Babylon were able to live long lives because of their daily devotion and commitment to Torah study and the commandments. For them, if a day went by void of learning Torah, it would be considered that that day was lost, and even never existed.
On this note, even if someone was 100 years old, but never learned Torah or did a Mitzvah, all the days of his life would be considered lost, G-D forbid. As only the days that we had Torah being studied were days that were actually counted as days in our life.
There is a famous story that we will recount now from the Holy Rabbi, Rebbe Meir M'Primashlan, may his memory be for a blessing, and this is what he told over -
There came to the heavens (after death) two souls. One was a very old man and one was a much younger man. The younger one was shown respect, and called up by the heavenly courts being referred to as an old man. The real older man however was called up by Heaven in terms only used for children!
The old man said "Isn't this heaven, the place of truth? I was the Sandek (holder of the baby) at this other souls Brit Milah, and now you are calling him old man implying he is older than me? I was there when he was just a baby!"
The heavens answered him back saying "This young man spent his nights studying Torah and serving HaShem, and this service of his did not lapse for even a day in his life, and that he achieved in his short life, what others would try to accomplish in their whole life, and because of this we call him old, unlike you, who wasted most of your days and they became lost from the tally of days you have, and whatever days you do have on your tally don't really add up to even a few years, and therefor you are considered just as old as a child, and you are correct, this is a place of truth here in the heavens, and with justice and truth we called you a child!"
And this principal is seen with Avraham as well - as the verse says -
וְאַבְרָהָ֣ם זָקֵ֔ן בָּ֖א בַּיָּמִ֑ים וַֽיהֹוָ֛ה בֵּרַ֥ךְ אֶת־אַבְרָהָ֖ם בַּכֹּֽל׃
Based on this verse, the Holy Zohar says -
תָּא חֲזֵי, אַבְרָהָם אִתְקְרִיב לְגַבֵּיהּ וְתִאוּבְתֵּיהּ דִּילֵיהּ הֲוָה כָּל יוֹמוֹי בְּהַאי, וְלָא אִתְקְרִיב אַבְרָהָם בְּיוֹמָא חָדָא אוֹ בְּזִמְנָא חָדָא, אֶלָּא עוֹבָדוֹי קְרִיבוּ לֵיהּ בְּכָל יוֹמוֹי מִדַּרְגָּא לְדַרְגָּא, עַד דְּאִסְתַּלַק בְּדַרְגּוֹי. כַּד הֲוָה סִיב וְעָאל בְּדַרְגִּין עִלָּאִין כְּדְקָא חָזֵי דִּכְתִיב וְאַבְרָהָם זָקֵן, וּכְדֵין בָּא בַּיָּמִים בְּאִינוּן יוֹמִין עִלָּאִין בְּאִינוּן יוֹמִין יְדִיעָאן בְּרָזָא דִמְהֵימְנוּתָא
Come and behold, Abraham came closer to (Hashem). All his days, his desire was (to come closer to Him). Abraham did not come closer through one day or at one time, but his good deeds brought him closer every day as he moved from one grade to another, until his grade was elevated.
When he was old, he entered the supernal grades as he deserved, as it is written, "And Abraham was old" and then "coming with the days." This refers to the supernal days, the days known by the secret of the faith.
Since Avraham sat in the house of study, and served HaShem all of his days, he was only then considered old, as the verse says "בָּ֖א בַּיָּמִ֑ים" He came with his days... what does that mean he came with his days? When he arrived at heaven all of his days were there with him, since he spent all of his days studying Torah and fulfilling the will of HaShem!
Now after learning this we can make sense of the Talmud that asks how the men of Babylon were able to age and live long. The term elder was placed only on those that spent their lives studying Torah and served throughout their life. So we can see, that if the men of Babylon were able to get to this lofty level, and we know that according to the Torah only the men of Israel are able to get to this level of elderly.. but since in Babylon they were early to study and late to leave (not just that they came to pray), that this coming early to Torah study, and late night study of Torah actually led to these men having days that actually counted as days, which all add up in the heavenly count of days, where they can then actually be considered old, and even these men in Babylon would be considered old in the world of truth (unlike other elderly humans that have no deeds for themselves).
This too was a the situation with Sarah our foremother, may she be loved by Heaven. Yes, it is true she had a life of many sufferings! But even still she served HaShem every day and in every situation she was in. This is why the verse comes to inform us about her reality when the verse says "these are the years of Sarahs life" - and Rashi comes in and says they were all added up to be good for her, which means that all her years (127) were intact and not less, since she did not lose a day due to lack of service, and this is why we say that her days were all added up and were good for her. Not that her days were good in terms of having fun, but were good in terms of being considered actual days for her in the world of truth!