Q:

Why is the entropy constant?

I'm a little confused about the second law of thermodynamics and the consequence that the entropy can only increase. To demonstrate my confusion I want to point out two examples:
1) (taken from Callen, page 153) 
2) (taken from Kardar, page 15) 
In the first example we consider the reservoir to be a part of the whole system while in the second we don't. Kardar says that the increase in entropy is relevant when we release some internal constraint while maintaining our system inside adiabatic walls. Then, the system will seek some new equilibrium state while increasing it's entropy. now, in the first example it is said that we release some internal constraint so why does the total entropy remains constant? by the same reasoning as in the second example I think that the entropy of the system (without the reservoir) should increase. does that mean that the entropy of the reservoir should decrease by the same amount? and if it does how come it does not violate the second law?
I know that these questions are basic but I am really confused about this so I hope someone can organize my thoughts. thanks :)

A:

In general case, the change of the entropy $S$ of the system can be presented as a sum of two contributions:
$$
dS=dS_\mathrm{ext}+dS_\mathrm{int}.
$$
The first term 
$$
dS_\mathrm{ext}=\frac{\delta Q}{T}
$$ 
is the "external" part caused by heat transmission. It is positive ($dS_\mathrm{ext}>0$) when the system absorbs some heat ($\delta Q>0$) and negative ($dS_\mathrm{ext}<0$) when the system returns heat to environment ($\delta Q<0$).
The "internal" part $dS_\mathrm{int}$ is the entropy change due to internal processes of equilibration in the system. It is always nonnegative, $dS_\mathrm{int}\geqslant0$, and vanishes in equilibrium processes.
In the first example (from Callen) the equation $d(S+S')=0$ refers to a final equilibrium state which we try to find (if I understood correctly). Physically this is a state established in the composite system when all equilibration processes have ended and thermal isolation from the environment is provided. In this case, $\delta Q=0$, $dS_\mathrm{int}=0$ thus total entropy is constant.

